Fix the bug for real
This takes care of a stack of multiple things.
This commit is contained in:
parent
4ad6735b84
commit
aa19025bab
14
src/vm.c
14
src/vm.c
|
@ -603,8 +603,18 @@ restart:
|
|||
bc_parse_err(&vm.prs, BC_ERROR_PARSE_STRING);
|
||||
#if BC_ENABLED
|
||||
else if (BC_IS_BC && BC_ERR(BC_PARSE_NO_EXEC(&vm.prs))) {
|
||||
if (BC_PARSE_TOP_FLAG(&vm.prs) == BC_PARSE_FLAG_IF_END)
|
||||
bc_vm_process("else {}", true);
|
||||
|
||||
size_t i;
|
||||
bool good = true;
|
||||
|
||||
for (i = 0; good && i < vm.prs.flags.len; ++i) {
|
||||
uint16_t flag = *((uint16_t*) bc_vec_item(&vm.prs.flags, i));
|
||||
good = ((flag & BC_PARSE_FLAG_BRACE) != BC_PARSE_FLAG_BRACE);
|
||||
}
|
||||
|
||||
if (good) {
|
||||
while (BC_PARSE_IF_END(&vm.prs)) bc_vm_process("else {}", true);
|
||||
}
|
||||
else bc_parse_err(&vm.prs, BC_ERROR_PARSE_BLOCK);
|
||||
}
|
||||
#endif // BC_ENABLED
|
||||
|
|
Loadingâ¦
Reference in New Issue