run frame_buff in local is not ok

This commit is contained in:
lyon1998 2022-03-14 14:04:21 +08:00
parent c21a1cfc3b
commit 7f0413a458

View File

@ -39,6 +39,11 @@ VMParameters* pikaVM_runAsmWithPars(PikaObj* self,
VMParameters* globals,
char* pikaAsm);
VMParameters* pikaVM_runByteCodeWithPars(PikaObj* self,
VMParameters* locals,
VMParameters* globals,
ByteCodeFrame* byteCode_frame);
static int32_t __gotoNextLine(char* code) {
int offset = 0;
while (1) {
@ -375,8 +380,18 @@ static Arg* VM_instruction_handler_RUN(PikaObj* self, VMState* vs, char* data) {
return_arg = arg_copy(args_getArg(sub_locals->list, (char*)"return"));
} else {
/* static method and object method */
sub_locals = pikaVM_runAsmWithPars(method_host_obj, sub_locals,
vs->globals, method_code);
if (vs->ASM_start == NULL) {
/* byteCode */
ByteCodeFrame bytecode_frame;
byteCodeFrame_init(&bytecode_frame);
sub_locals = pikaVM_runByteCodeWithPars(
method_host_obj, sub_locals, vs->globals, &bytecode_frame);
byteCodeFrame_deinit(&bytecode_frame);
} else {
/* Asm */
sub_locals = pikaVM_runAsmWithPars(method_host_obj, sub_locals,
vs->globals, method_code);
}
/* get method return */
return_arg = arg_copy(args_getArg(sub_locals->list, (char*)"return"));
}