Skip to content

Commit

Permalink
Add proper error messages for failed stack checks (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobil4sk authored Jul 2, 2024
1 parent c580c36 commit 90939ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vm/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ neko_module *neko_read_module( reader r, readp p, value loader ) {
memset(stmp,UNKNOWN,m->codesize+1);
if( !vm->trusted_code && !neko_check_stack(m,stmp,0,0,0) ) {
free(stmp);
ERROR();
failure("Stack check failed for global scope");
}
for(i=0;i<m->nglobals;i++) {
vfunction *f = (vfunction*)m->globals[i];
Expand All @@ -557,7 +557,7 @@ neko_module *neko_read_module( reader r, readp p, value loader ) {
}
if( !vm->trusted_code && !neko_check_stack(m,stmp,itmp,f->nargs,f->nargs) ) {
free(stmp);
ERROR();
failure("Stack check failed for function scope");
}
f->addr = m->code + itmp;
prev = itmp;
Expand Down

0 comments on commit 90939ab

Please sign in to comment.