Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'if %(self)' in a match object can cause 'Null PMC access in get_bool()' #787

Closed
p6rt opened this issue Mar 15, 2009 · 5 comments
Closed
Labels

Comments

@p6rt
Copy link

p6rt commented Mar 15, 2009

Migrated from rt.perl.org#63904 (status was 'resolved')

Searchable as RT63904$

@p6rt
Copy link
Author

p6rt commented Mar 15, 2009

From @moritz

Rakudo 087e299898416ca6c3a6e2b2bdc3785d841f0ec6​:

# test file​:
grammar Expr {
  rule TOP { ^ \d+ [ <operator> \d+ ]* }
  token operator { '/' | '*' | '+' | '-' };
};

if Expr.parse('2 + 4') { say $/.perl; }

# output​:
Null PMC access in get_bool()
current instr.​: 'parrot;Match;_block1144' pc 33028
(src/gen_setting.pir​:3592)
called from Sub 'gather' pc 15603 (src/builtins/control.pir​:114)
called from Sub 'parrot;Match;!_perl' pc 32448 (src/gen_setting.pir​:3458)
called from Sub 'parrot;Match;_block1219' pc 33592
(src/gen_setting.pir​:3779)
called from Sub 'parrot;Match;_block1206' pc 33411
(src/gen_setting.pir​:3720)
called from Sub 'parrot;Match;_block1144' pc 32926
(src/gen_setting.pir​:3576)
called from Sub 'gather' pc 15603 (src/builtins/control.pir​:114)
called from Sub 'parrot;Match;!_perl' pc 32448 (src/gen_setting.pir​:3458)
called from Sub 'parrot;Match;_block1294' pc 34243
(src/gen_setting.pir​:3982)
called from Sub 'parrot;Match;_block1274' pc 34033
(src/gen_setting.pir​:3912)
called from Sub 'parrot;Match;_block1256' pc 33808
(src/gen_setting.pir​:3838)
called from Sub 'parrot;Match;_block1144' pc 33040
(src/gen_setting.pir​:3596)
called from Sub 'gather' pc 15603 (src/builtins/control.pir​:114)
called from Sub 'parrot;Match;!_perl' pc 32448 (src/gen_setting.pir​:3458)
called from Sub 'parrot;Match;perl' pc 32322 (src/gen_setting.pir​:3413)
called from Sub '_block32' pc 1168 (EVAL_24​:468)
called from Sub '_block14' pc 107 (EVAL_24​:52)
called from Sub '!UNIT_START' pc 17161 (src/builtins/guts.pir​:325)
called from Sub 'parrot;PCT;HLLCompiler;eval' pc 950
(src/PCT/HLLCompiler.pir​:527)
called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1275
(src/PCT/HLLCompiler.pir​:688)
called from Sub 'parrot;PCT;HLLCompiler;command_line' pc 1456
(src/PCT/HLLCompiler.pir​:778)
called from Sub 'parrot;Perl6;Compiler;main' pc 21458 (perl6.pir​:163)

The error occurs in line 31 of src/setting/Match.pm

  if %(self) {

At this point self.PARROT says Perl6Scalar->Expr, normally ?%(self)
works when
self is 'Expr' (without the Perl6Scalar part)

@p6rt
Copy link
Author

p6rt commented Apr 20, 2009

From @moritz

On Sun Mar 15 12​:01​:32 2009, moritz wrote​:

Rakudo 087e299898416ca6c3a6e2b2bdc3785d841f0ec6​:

# test file​:
grammar Expr {
rule TOP { ^ \d+ [ <operator> \d+ ]* }
token operator { '/' | '*' | '+' | '-' };
};

if Expr.parse('2 + 4') { say $/.perl; }

# output​:
Null PMC access in get_bool()
current instr.​: 'parrot;Match;_block1144' pc 33028
(src/gen_setting.pir​:3592)
called from Sub 'gather' pc 15603 (src/builtins/control.pir​:114)
called from Sub 'parrot;Match;!_perl' pc 32448 (src/gen_setting.pir​:3458)
called from Sub 'parrot;Match;_block1219' pc 33592
(src/gen_setting.pir​:3779)
called from Sub 'parrot;Match;_block1206' pc 33411
(src/gen_setting.pir​:3720)
called from Sub 'parrot;Match;_block1144' pc 32926
(src/gen_setting.pir​:3576)
called from Sub 'gather' pc 15603 (src/builtins/control.pir​:114)
called from Sub 'parrot;Match;!_perl' pc 32448 (src/gen_setting.pir​:3458)
called from Sub 'parrot;Match;_block1294' pc 34243
(src/gen_setting.pir​:3982)
called from Sub 'parrot;Match;_block1274' pc 34033
(src/gen_setting.pir​:3912)
called from Sub 'parrot;Match;_block1256' pc 33808
(src/gen_setting.pir​:3838)
called from Sub 'parrot;Match;_block1144' pc 33040
(src/gen_setting.pir​:3596)
called from Sub 'gather' pc 15603 (src/builtins/control.pir​:114)
called from Sub 'parrot;Match;!_perl' pc 32448 (src/gen_setting.pir​:3458)
called from Sub 'parrot;Match;perl' pc 32322 (src/gen_setting.pir​:3413)
called from Sub '_block32' pc 1168 (EVAL_24​:468)
called from Sub '_block14' pc 107 (EVAL_24​:52)
called from Sub '!UNIT_START' pc 17161 (src/builtins/guts.pir​:325)
called from Sub 'parrot;PCT;HLLCompiler;eval' pc 950
(src/PCT/HLLCompiler.pir​:527)
called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1275
(src/PCT/HLLCompiler.pir​:688)
called from Sub 'parrot;PCT;HLLCompiler;command_line' pc 1456
(src/PCT/HLLCompiler.pir​:778)
called from Sub 'parrot;Perl6;Compiler;main' pc 21458 (perl6.pir​:163)

The error occurs in line 31 of src/setting/Match.pm

if %\(self\) \{

At this point self.PARROT says Perl6Scalar->Expr, normally ?%(self)
works when
self is 'Expr' (without the Perl6Scalar part)

pmichaud fixed it in 480902edc93fd79bcfe354038c2cce078b9cb868, so I'll
take care that we'll get some tests.

Moritz

@p6rt
Copy link
Author

p6rt commented Apr 20, 2009

@moritz - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Apr 24, 2009

From @moritz

Tested in S05-match/perl.t.

Moritz

@p6rt
Copy link
Author

p6rt commented Apr 24, 2009

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Apr 24, 2009
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant