stage1 人工重构ast以及type部分 修复vm的UB行为

This commit is contained in:
zzy
2026-08-14 18:10:58 +08:00
parent b0e6b406ac
commit c06d7247bb
7 changed files with 142 additions and 306 deletions

View File

@@ -99,9 +99,10 @@ static int spl_type_size(spl_type_t t) {
#define PUSH(v) \
do { \
spl_val_t _pv = (spl_val_t)(v); \
if (vm->sp >= vm->config.max_stack_depth) \
VM_ERROR("stack overflow"); \
vm->stacks.data[(vm->sp)++] = (spl_val_t)(v); \
vm->stacks.data[(vm->sp)++] = _pv; \
} while (0)
#define POP() vm->stacks.data[--(vm->sp)]