Get rid of OP_UNUSED and implement additional context frame to resolve scope issue
Some checks failed
Build / AerScript (push) Failing after 28s

This commit is contained in:
2025-08-29 14:32:01 +02:00
parent a167e4bc87
commit 5ff7d03ed1
4 changed files with 63 additions and 55 deletions

View File

@@ -1249,11 +1249,12 @@ struct VmFrame {
sxu32 iExceptionJump; /* Exception jump destination */
};
#define VM_FRAME_ACTIVE 0x01 /* Active call frame */
#define VM_FRAME_LOOP 0x02 /* Active loop frame */
#define VM_FRAME_EXCEPTION 0x04 /* Special Exception frame */
#define VM_FRAME_THROW 0x08 /* An exception was thrown */
#define VM_FRAME_CATCH 0x10 /* Catch frame */
#define VM_FRAME_FINALLY 0x20 /* Finally frame */
#define VM_FRAME_CONTEXT 0x02 /* Active context frame */
#define VM_FRAME_LOOP 0x04 /* Active loop frame */
#define VM_FRAME_EXCEPTION 0x08 /* Special Exception frame */
#define VM_FRAME_THROW 0x10 /* An exception was thrown */
#define VM_FRAME_CATCH 0x20 /* Catch frame */
#define VM_FRAME_FINALLY 0x40 /* Finally frame */
/*
* When a debug stacktrace is extracted from Virtual Machine, all information about
* calls (file, line, class, method, arguments) are stored in this structure.
@@ -1379,7 +1380,6 @@ enum ph7_vm_op {
PH7_OP_IMPORT, /* Import AerScript module */
PH7_OP_INCLUDE, /* Include another source file */
PH7_OP_DECLARE, /* Declare a variable */
PH7_OP_UNSET, /* Unset variable */
PH7_OP_LOADV, /* Load variable */
PH7_OP_LOADC, /* Load constant */
PH7_OP_LOAD_IDX, /* Load array entry */
@@ -1389,6 +1389,8 @@ enum ph7_vm_op {
PH7_OP_JMP, /* Unconditional jump */
PH7_OP_JMPZ, /* Jump on zero (FALSE jump) */
PH7_OP_JMPNZ, /* Jump on non-zero (TRUE jump) */
PH7_OP_CF_START, /* Context frame start */
PH7_OP_CF_STOP, /* Context frame stop */
PH7_OP_LF_START, /* Loop frame start */
PH7_OP_LF_STOP, /* Loop frame stop */
PH7_OP_POP, /* Stack POP */