From 66412f65b65ce59c70804b1ba49dc4b5d13d2399 Mon Sep 17 00:00:00 2001 From: cozis Date: Sun, 13 Mar 2022 21:34:47 +0100 Subject: [PATCH] fixed build error for gcc 9 --- src/common/executable.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/common/executable.c b/src/common/executable.c index 25caf20..2a87f16 100644 --- a/src/common/executable.c +++ b/src/common/executable.c @@ -243,15 +243,16 @@ _Bool Executable_Fetch(Executable *exe, int index, Opcode *opcode, Operand *ops, switch(type) { case OPTP_STRING: + { + int data_offset = instr->operands[i].as_int; - int data_offset = instr->operands[i].as_int; - - assert(data_offset < exe->headl); - - ops[i].type = OPTP_STRING; - ops[i].as_string = exe->head + data_offset; - break; + assert(data_offset < exe->headl); + ops[i].type = OPTP_STRING; + ops[i].as_string = exe->head + data_offset; + break; + } + case OPTP_INT: ops[i].type = OPTP_INT; ops[i].as_int = instr->operands[i].as_int;