Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix detection of runtime errors in threads.
I can only imagine this must have worked at some point in the past,
but it sure didn't now. More odd is that this only showed up some
of them time. Anyway, fixed now, and simple programs doing things
like `await start die 'foo'` will now not report errors as if they
were compile-time.
  • Loading branch information
jnthn committed Dec 20, 2016
1 parent e8573e7 commit b8df3a6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/core/Backtrace.pm
Expand Up @@ -315,15 +315,14 @@ my class Backtrace {
my $bt = $!bt;
for $bt.keys {
my $p6sub := $bt[$_]<sub>;
if nqp::istype($p6sub, Sub) {
return True if $p6sub.name eq 'THREAD-ENTRY';
}
elsif nqp::istype($p6sub, ForeignCode) {
if nqp::istype($p6sub, ForeignCode) {
try {
my Mu $sub := nqp::getattr(nqp::decont($p6sub), ForeignCode, '$!do');
return True if nqp::iseq_s(nqp::getcodename($sub), 'eval');
return True if nqp::iseq_s(nqp::getcodename($sub), 'print_control');
return False if nqp::iseq_s(nqp::getcodename($sub), 'compile');
my str $name = nqp::getcodename($sub);
return True if nqp::iseq_s($name, 'THREAD-ENTRY');
return True if nqp::iseq_s($name, 'eval');
return True if nqp::iseq_s($name, 'print_control');
return False if nqp::iseq_s($name, 'compile');
}
}
}
Expand Down

0 comments on commit b8df3a6

Please sign in to comment.