summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-02 23:55:51 +0200
committerJo-Philipp Wich <jo@mein.io>2020-10-02 23:55:51 +0200
commitd69fe00baba5f262dd0008ba01a4d4fa09c424a8 (patch)
tree0a950607e6ce50ac6a025f7b3d15a09de38ed3dd
parentd03f4f4b0f770cdb16abf630179070c46031518d (diff)
eval: properly forward execeptions in for-in loop value evaluation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--eval.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index c7cad75..d6094ca 100644
--- a/eval.c
+++ b/eval.c
@@ -582,6 +582,12 @@ ut_execute_for(struct ut_state *state, uint32_t off)
scope = local ? ut_getscope(state, 0) : ut_getref(state, ut_get_off(state, ivar), NULL);
+ if (ut_is_type(scope, T_EXCEPTION)) {
+ ut_putval(val);
+
+ return scope;
+ }
+
if (json_object_is_type(val, json_type_array)) {
for (arridx = 0, arrlen = json_object_array_length(val);
arridx < arrlen; arridx++) {