diff options
author | Alice Frosi <afrosi@redhat.com> | 2023-06-05 14:06:33 +0200 |
---|---|---|
committer | Alice Frosi <afrosi@redhat.com> | 2023-06-05 14:06:33 +0200 |
commit | 12129d46981106fa0d356cfd6000d6006942f0e4 (patch) | |
tree | 51bbac6dd6201fb2e3465d36470d16424714307f /cooker/emit.c | |
parent | c021082abcc9d94c2e94679f6729265fe65529a3 (diff) | |
download | seitan-12129d46981106fa0d356cfd6000d6006942f0e4.tar seitan-12129d46981106fa0d356cfd6000d6006942f0e4.tar.gz seitan-12129d46981106fa0d356cfd6000d6006942f0e4.tar.bz2 seitan-12129d46981106fa0d356cfd6000d6006942f0e4.tar.lz seitan-12129d46981106fa0d356cfd6000d6006942f0e4.tar.xz seitan-12129d46981106fa0d356cfd6000d6006942f0e4.tar.zst seitan-12129d46981106fa0d356cfd6000d6006942f0e4.zip |
cooker: add emit_end
Diffstat (limited to 'cooker/emit.c')
-rw-r--r-- | cooker/emit.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cooker/emit.c b/cooker/emit.c index e2b5461..625ff69 100644 --- a/cooker/emit.c +++ b/cooker/emit.c @@ -296,6 +296,22 @@ void emit_copy_field(struct gluten_ctx *g, struct field *field, field->size ? field->size : gluten_size[field->type]); } +/** + * emit_end() - Emit OP_END instruction: end of the operation block + * @g: gluten context + */ +void emit_end(struct gluten_ctx *g) +{ + struct op *op = (struct op *)gluten_ptr(&g->g, g->ip); + + op->type = OP_END; + + debug(" %i: OP_END", g->ip.offset); + + if (++g->ip.offset > INST_MAX) + die("Too many instructions"); +} + static struct gluten_offset emit_data_do(struct gluten_ctx *g, struct gluten_offset offset, enum type type, size_t str_len, |