You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turns out a lex_lookup may return something that triggers a NULL PMC Access when trying to check its value. Here's a piece of code I added to actions.pm
src/gen_diff --git a/src/parser/actions.pm b/src/parser/actions.pm
index cd49492..f706b95 100644
--- a/src/parser/actions.pm
+++ b/src/parser/actions.pm
@@ -905,6 +905,9 @@ sub is_a_sub($name) {
}
}
my $lex := lex_lookup($name);
+ print("is_a_sub('"); print($name); print("'), here we crash\n");
+ if $lex { print("lex ok\n"); }
+ print("never happens\n");
if $lex && ~lookup_class($lex) eq 'Sub' { return 1; }
return 0;
}
is_a_sub('Test'), here we crash
Null PMC access in get_bool()
current instr.: 'cardinal;cardinal;Grammar;Actions;is_a_sub' pc 64437 (src/gen_grammar.pir:288)
called from Sub 'cardinal;cardinal;Grammar;Actions;variable' pc 68543 (src/gen_grammar.pir:1720)
called from Sub 'cardinal;cardinal;Grammar;variable' pc 34593 (src/classes/File.pir:8150)
called from Sub 'cardinal;cardinal;Grammar;basic_primary' pc 36938 (src/classes/FileStat.pir:9021)
called from Sub 'cardinal;cardinal;Grammar;primary' pc 37455 (src/classes/Dir.pir:9206)
called from Sub 'cardinal;PGE;OPTable;parse' pc 1940 (compilers/pge/PGE/OPTable.pir:566)
called from Sub 'cardinal;cardinal;Grammar;args' pc 35975 (src/classes/FileStat.pir:8665)
called from Sub 'cardinal;cardinal;Grammar;call_args' pc 29791 (src/classes/Kernel.pir:6346)
called from Sub 'cardinal;cardinal;Grammar;post_primary_expr' pc 37995 (src/classes/Dir.pir:9406)
called from Sub 'cardinal;cardinal;Grammar;primary' pc 37567 (src/classes/Dir.pir:9246)
called from Sub 'cardinal;PGE;OPTable;parse' pc 1940 (compilers/pge/PGE/OPTable.pir:566)
called from Sub 'cardinal;cardinal;Grammar;expr' pc 20368 (src/classes/Array.pir:2777)
called from Sub 'cardinal;cardinal;Grammar;basic_stmt' pc 17591 (src/classes/Array.pir:1717)
called from Sub 'cardinal;cardinal;Grammar;stmt' pc 18974 (src/classes/Array.pir:2227)
called from Sub 'cardinal;cardinal;Grammar;stmts' pc 14166 (src/classes/Array.pir:448)
called from Sub 'cardinal;cardinal;Grammar;comp_stmt' pc 13647 (src/classes/Array.pir:249)
called from Sub 'cardinal;cardinal;Grammar;TOP' pc 13302 (src/classes/Array.pir:115)
called from Sub 'cardinal;PCT;HLLCompiler;parse' pc 826 (compilers/pct/src/PCT/HLLCompiler.pir:463)
called from Sub 'cardinal;PCT;HLLCompiler;compile' pc 464 (compilers/pct/src/PCT/HLLCompiler.pir:331)
called from Sub 'cardinal;PCT;HLLCompiler;eval' pc 1081 (compilers/pct/src/PCT/HLLCompiler.pir:582)
called from Sub 'cardinal;PCT;HLLCompiler;evalfiles' pc 1501 (compilers/pct/src/PCT/HLLCompiler.pir:764)
called from Sub 'cardinal;PCT;HLLCompiler;command_line' pc 1712 (compilers/pct/src/PCT/HLLCompiler.pir:873)
called from Sub 'cardinal;cardinal;Compiler;main' pc 78706 (src/gen_grammar.pir:5354)
The text was updated successfully, but these errors were encountered:
Turns out a lex_lookup may return something that triggers a NULL PMC Access when trying to check its value. Here's a piece of code I added to actions.pm
Running ./installable_cardinal t/02-functions.t results in:
is_a_sub('Test'), here we crash
Null PMC access in get_bool()
current instr.: 'cardinal;cardinal;Grammar;Actions;is_a_sub' pc 64437 (src/gen_grammar.pir:288)
called from Sub 'cardinal;cardinal;Grammar;Actions;variable' pc 68543 (src/gen_grammar.pir:1720)
called from Sub 'cardinal;cardinal;Grammar;variable' pc 34593 (src/classes/File.pir:8150)
called from Sub 'cardinal;cardinal;Grammar;basic_primary' pc 36938 (src/classes/FileStat.pir:9021)
called from Sub 'cardinal;cardinal;Grammar;primary' pc 37455 (src/classes/Dir.pir:9206)
called from Sub 'cardinal;PGE;OPTable;parse' pc 1940 (compilers/pge/PGE/OPTable.pir:566)
called from Sub 'cardinal;cardinal;Grammar;args' pc 35975 (src/classes/FileStat.pir:8665)
called from Sub 'cardinal;cardinal;Grammar;call_args' pc 29791 (src/classes/Kernel.pir:6346)
called from Sub 'cardinal;cardinal;Grammar;post_primary_expr' pc 37995 (src/classes/Dir.pir:9406)
called from Sub 'cardinal;cardinal;Grammar;primary' pc 37567 (src/classes/Dir.pir:9246)
called from Sub 'cardinal;PGE;OPTable;parse' pc 1940 (compilers/pge/PGE/OPTable.pir:566)
called from Sub 'cardinal;cardinal;Grammar;expr' pc 20368 (src/classes/Array.pir:2777)
called from Sub 'cardinal;cardinal;Grammar;basic_stmt' pc 17591 (src/classes/Array.pir:1717)
called from Sub 'cardinal;cardinal;Grammar;stmt' pc 18974 (src/classes/Array.pir:2227)
called from Sub 'cardinal;cardinal;Grammar;stmts' pc 14166 (src/classes/Array.pir:448)
called from Sub 'cardinal;cardinal;Grammar;comp_stmt' pc 13647 (src/classes/Array.pir:249)
called from Sub 'cardinal;cardinal;Grammar;TOP' pc 13302 (src/classes/Array.pir:115)
called from Sub 'cardinal;PCT;HLLCompiler;parse' pc 826 (compilers/pct/src/PCT/HLLCompiler.pir:463)
called from Sub 'cardinal;PCT;HLLCompiler;compile' pc 464 (compilers/pct/src/PCT/HLLCompiler.pir:331)
called from Sub 'cardinal;PCT;HLLCompiler;eval' pc 1081 (compilers/pct/src/PCT/HLLCompiler.pir:582)
called from Sub 'cardinal;PCT;HLLCompiler;evalfiles' pc 1501 (compilers/pct/src/PCT/HLLCompiler.pir:764)
called from Sub 'cardinal;PCT;HLLCompiler;command_line' pc 1712 (compilers/pct/src/PCT/HLLCompiler.pir:873)
called from Sub 'cardinal;cardinal;Compiler;main' pc 78706 (src/gen_grammar.pir:5354)
The text was updated successfully, but these errors were encountered: