diff options
author | Alice Frosi <afrosi@redhat.com> | 2023-06-02 14:25:30 +0200 |
---|---|---|
committer | Alice Frosi <afrosi@redhat.com> | 2023-06-02 14:26:21 +0200 |
commit | fb2a89cbfc5049d360bb734b4896946e9963e39a (patch) | |
tree | 58e9c939ce7a1819bdfb803837b899b46da31e2e /cooker/call.c | |
parent | 80309fbd77cbafa3784fa7295afb56c446d59b93 (diff) | |
download | seitan-fb2a89cbfc5049d360bb734b4896946e9963e39a.tar seitan-fb2a89cbfc5049d360bb734b4896946e9963e39a.tar.gz seitan-fb2a89cbfc5049d360bb734b4896946e9963e39a.tar.bz2 seitan-fb2a89cbfc5049d360bb734b4896946e9963e39a.tar.lz seitan-fb2a89cbfc5049d360bb734b4896946e9963e39a.tar.xz seitan-fb2a89cbfc5049d360bb734b4896946e9963e39a.tar.zst seitan-fb2a89cbfc5049d360bb734b4896946e9963e39a.zip |
cooker, seitan: fix some bugs for op call
cooker:
- added missing OP_CALL type
- local copy of the offset for the type STRUCT
- fix return offset
- added type LONG in emit_data
seitan:
- check context if NULL
- fix ptr dereference
- added a couple of debug print
- added error message in seitan for eval
Diffstat (limited to 'cooker/call.c')
-rw-r--r-- | cooker/call.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cooker/call.c b/cooker/call.c index db2d6b8..9561568 100644 --- a/cooker/call.c +++ b/cooker/call.c @@ -57,7 +57,7 @@ Examples of arguments: parse_arg() passes ro_data offset - STRUCT: 1, 2 write struct to ro_data, and pointer to it - parse_tag() passes ro_data offset + parse_arg() passes ro_data offset - STRUCT: "get" <tag> write pointer to tag parse_arg() passes null offset @@ -208,14 +208,14 @@ static union value parse_field(struct gluten_ctx *g, struct arg *args, break; case STRUCT: for (f_inner = f->desc.d_struct; f_inner->name; f_inner++) { + struct gluten_offset struct_start = offset; JSON_Value *f_value; tmp1 = json_value_get_object(jvalue); f_value = json_object_get_value(tmp1, f_inner->name); if (!f_value) continue; - - parse_field(g, args, &offset, index, f_inner, f_value, + parse_field(g, args, &struct_start, index, f_inner, f_value, false, add); } break; @@ -323,7 +323,6 @@ static struct gluten_offset parse_arg(struct gluten_ctx *g, struct arg *args, offset = gluten_rw_alloc(g, a->f.size); else if (a->f.size && !top_level_tag) offset = gluten_ro_alloc(g, a->f.size); - parse_field(g, args, &offset, a->pos, &a->f, jvalue, false, false); return offset; |