summaryrefslogtreecommitdiffhomepage
path: root/eval.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-02 23:52:22 +0200
committerJo-Philipp Wich <jo@mein.io>2020-10-02 23:55:03 +0200
commitd03f4f4b0f770cdb16abf630179070c46031518d (patch)
treef6c746bdf64006acf0366d125b2deea5a14c2d1e /eval.c
parenta57aa8262ead82aaf2e9eec3d11d473186e7a33a (diff)
ast: store function declarations as opcode offsets
We cannot use direct pointers since the opcode array might be reallocated resulting in potentially changed memory addresses. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index cfee806..c7cad75 100644
--- a/eval.c
+++ b/eval.c
@@ -1050,7 +1050,7 @@ ut_invoke(struct ut_state *state, uint32_t off, struct json_object *scope,
return cfn ? cfn(state, off, argvals) : NULL;
}
- decl = tag->tag.data;
+ decl = ut_get_op(state, tag->tag.off);
arg = ut_get_op(state, decl ? decl->tree.operand[1] : 0);
s = scope ? scope : ut_addscope(state, ut_get_off(state, decl));