diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-09-10 15:33:47 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-09-10 15:33:47 +0200 |
commit | 05b5b677afa6af3026da2c49222ac8358992392d (patch) | |
tree | 277cab24dcc6ddb3232e232308f262102ffe529f | |
parent | 394fe98efd6e11885d0786e9f9aabf284f6f363a (diff) |
eval: fix [] subscript operator
Fixes: c735882 ("parser, eval: use an ut_op flag to denote postfix access")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | eval.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -245,7 +245,7 @@ ut_ref_to_str(struct ut_state *state, uint32_t off) return p; case T_LBRACK: - if (!op->val) + if (!op->is_postfix) return NULL; s = ut_ref_to_str(state, op->tree.operand[0]); @@ -286,7 +286,7 @@ ut_getref(struct ut_state *state, uint32_t off, struct json_object **key) return ut_execute_op(state, off1); } - else if (op && op->type == T_LBRACK && op->val) { + else if (op && op->type == T_LBRACK && op->is_postfix) { *key = off2 ? ut_execute_op(state, off2) : NULL; return ut_execute_op(state, off1); |