1
0
Fork 0
forked from fun/fun

Fixed try/catch to run finally again. exit() in catch if you want to stop execution. (0.37.62)

This commit is contained in:
Johannes Findeisen 2026-01-24 21:17:40 +01:00
commit 869d68b992
4 changed files with 43 additions and 5 deletions

View file

@ -122,6 +122,12 @@ void vm_dump_globals(VM *vm);
// run entry Bytecode (pushes first frame)
void vm_run(VM *vm, Bytecode *entry);
/* Raise a runtime error that respects try/catch/finally.
* If a try handler is active in the current frame, control jumps to it
* with an error string pushed on the stack. Otherwise, prints the error
* (annotated with location) and terminates execution. */
void vm_raise_error(VM *vm, const char *msg);
/* --- Debugger API --- */
void vm_debug_reset(VM *vm);
int vm_debug_add_breakpoint(VM *vm, const char *file, int line); // returns id >=0 or -1