Browse Source

always trigger break_on_trap at topmost catch (this is the C one)

Nicolas Cannasse 3 years ago
parent
commit
a23b60636d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/std/error.c

+ 1 - 1
src/std/error.c

@@ -79,7 +79,7 @@ HL_PRIM void hl_set_error_handler( vclosure *d ) {
 
 static bool break_on_trap( hl_thread_info *t, hl_trap_ctx *trap, vdynamic *v ) {
 	while( true ) {
-		if( trap == NULL || trap == t->trap_uncaught || t->trap_current == NULL ) return true;
+		if( trap == NULL || trap == t->trap_uncaught || t->trap_current == NULL || trap->prev == NULL ) return true;
 		if( !trap->tcheck || !v ) return false;
 		hl_type *ot = ((hl_type**)trap->tcheck)[1]; // it's an obj with first field is a hl_type
 		if( !ot || hl_safe_cast(v->t,ot) ) return false;