Skip to content

Commit 90939ab

Browse files
authored
Add proper error messages for failed stack checks (#284)
1 parent c580c36 commit 90939ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vm/module.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ neko_module *neko_read_module( reader r, readp p, value loader ) {
545545
memset(stmp,UNKNOWN,m->codesize+1);
546546
if( !vm->trusted_code && !neko_check_stack(m,stmp,0,0,0) ) {
547547
free(stmp);
548-
ERROR();
548+
failure("Stack check failed for global scope");
549549
}
550550
for(i=0;i<m->nglobals;i++) {
551551
vfunction *f = (vfunction*)m->globals[i];
@@ -557,7 +557,7 @@ neko_module *neko_read_module( reader r, readp p, value loader ) {
557557
}
558558
if( !vm->trusted_code && !neko_check_stack(m,stmp,itmp,f->nargs,f->nargs) ) {
559559
free(stmp);
560-
ERROR();
560+
failure("Stack check failed for function scope");
561561
}
562562
f->addr = m->code + itmp;
563563
prev = itmp;

0 commit comments

Comments
 (0)