mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-07-26 21:08:45 +08:00
⚡ add stl/json.nas & fix bug
bug: may cause program crash if stack overflow occurs on main stack
This commit is contained in:
+8
-8
@@ -301,14 +301,12 @@ void nasal_dbg::run(
|
||||
++count[code[pc]];
|
||||
(this->*oprs[code[pc]])();
|
||||
if(top>=canary)
|
||||
break;
|
||||
die("stack overflow");
|
||||
++pc;
|
||||
}
|
||||
#endif
|
||||
|
||||
vmexit:
|
||||
if(top>=canary)
|
||||
die("stack overflow");
|
||||
callsort(count);
|
||||
gc.clear();
|
||||
imm.clear();
|
||||
@@ -316,12 +314,14 @@ vmexit:
|
||||
return;
|
||||
#ifndef _MSC_VER
|
||||
#define dbg(op,num) {\
|
||||
interact();\
|
||||
op();\
|
||||
++count[num];\
|
||||
if(top<canary)\
|
||||
interact();\
|
||||
op();\
|
||||
++count[num];\
|
||||
if(top<canary)\
|
||||
goto *code[++pc];\
|
||||
die("stack overflow");\
|
||||
goto *code[++pc];\
|
||||
goto vmexit;}
|
||||
}
|
||||
|
||||
intg: dbg(o_intg ,op_intg );
|
||||
intl: dbg(o_intl ,op_intl );
|
||||
|
||||
Reference in New Issue
Block a user