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

Null PMC access when doing 'say $foo::' (which shouldn't even parse) in Rakudo #1913

Closed
p6rt opened this issue Jul 6, 2010 · 9 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Jul 6, 2010

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

Searchable as RT76400$

@p6rt
Copy link
Author

p6rt commented Jul 6, 2010

From @masak

<p6eval> std 31559​: OUTPUT«ok 00​:01 111m␤»
<TimToady> I didn't expect that to work :)
<masak> std bug.
* TimToady bug
<TimToady> I'm not entirely sure how it parsed...
<TimToady> oh, morename allows a final :​: component, but that's not
quite what you want here
<TimToady> std​: $defeat-the-name-checker​::
<p6eval> std 31559​: OUTPUT«ok 00​:01 108m␤»
<masak> rakudo​: $foo​::; say "alive"
<p6eval> rakudo 04a918​: OUTPUT«alive␤»
* masak submits rakudobug
<TimToady> rakudo​: $foo​:: = 42; say $foo​::;
<p6eval> rakudo 04a918​: OUTPUT«Null PMC access in getprop() [...]
<masak> ok, that goes in the same ticket :)
* masak upgrades the ticket to a Null PMC access
<masak> rakudo​: say $foo​::
<p6eval> rakudo 04a918​: OUTPUT«Null PMC access in type() [...]

@p6rt
Copy link
Author

p6rt commented Jul 29, 2010

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

@p6rt
Copy link
Author

p6rt commented Oct 8, 2011

From @coke

On Tue Jul 06 09​:19​:10 2010, masak wrote​:

<p6eval> std 31559​: OUTPUT«ok 00​:01 111m␤»
<TimToady> I didn't expect that to work :)
<masak> std bug.
* TimToady bug
<TimToady> I'm not entirely sure how it parsed...
<TimToady> oh, morename allows a final :​: component, but that's not
quite what you want here
<TimToady> std​: $defeat-the-name-checker​::
<p6eval> std 31559​: OUTPUT«ok 00​:01 108m␤»
<masak> rakudo​: $foo​::; say "alive"
<p6eval> rakudo 04a918​: OUTPUT«alive␤»
* masak submits rakudobug
<TimToady> rakudo​: $foo​:: = 42; say $foo​::;
<p6eval> rakudo 04a918​: OUTPUT«Null PMC access in getprop() [...]
<masak> ok, that goes in the same ticket :)
* masak upgrades the ticket to a Null PMC access
<masak> rakudo​: say $foo​::
<p6eval> rakudo 04a918​: OUTPUT«Null PMC access in type() [...]

No more NPAs​:

16​:01 < [Coke]> rakudo​: $foo​:: = 42; say $foo​::;
16​:01 <+p6eval> rakudo 88c5a5​: OUTPUT«42␤»
16​:01 < [Coke]> rakudo​: say $foo​::
16​:01 <+p6eval> rakudo 88c5a5​: OUTPUT«Any()␤»

Closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Nov 13, 2013

From @coke

On Sat Oct 08 13​:03​:15 2011, coke wrote​:

On Tue Jul 06 09​:19​:10 2010, masak wrote​:

<p6eval> std 31559​: OUTPUT«ok 00​:01 111m␤»
<TimToady> I didn't expect that to work :)
<masak> std bug.
* TimToady bug
<TimToady> I'm not entirely sure how it parsed...
<TimToady> oh, morename allows a final :​: component, but that's not
quite what you want here
<TimToady> std​: $defeat-the-name-checker​::
<p6eval> std 31559​: OUTPUT«ok 00​:01 108m␤»
<masak> rakudo​: $foo​::; say "alive"
<p6eval> rakudo 04a918​: OUTPUT«alive␤»
* masak submits rakudobug
<TimToady> rakudo​: $foo​:: = 42; say $foo​::;
<p6eval> rakudo 04a918​: OUTPUT«Null PMC access in getprop() [...]
<masak> ok, that goes in the same ticket :)
* masak upgrades the ticket to a Null PMC access
<masak> rakudo​: say $foo​::
<p6eval> rakudo 04a918​: OUTPUT«Null PMC access in type() [...]

No more NPAs​:

16​:01 < [Coke]> rakudo​: $foo​:: = 42; say $foo​::;
16​:01 <+p6eval> rakudo 88c5a5​: OUTPUT«42␤»
16​:01 < [Coke]> rakudo​: say $foo​::
16​:01 <+p6eval> rakudo 88c5a5​: OUTPUT«Any()␤»

Closable with tests.

Behavior changed again​:

21​:05 < [Coke]> r​: $foo​:: = 42; say $foo​::; # RT # 76400
21​:05 <+camelia> rakudo-jvm e54ad4​: OUTPUT«===SORRY!=== Error while compiling
  /tmp/MANE8TYdIa␤Variable '$foo' is not declared␤at
  /tmp/MANE8TYdIa​:1␤------> $foo​::⏏ = 42; say $foo​::; # RT #
  76400␤ expecting any of​:␤ postfix␤»
21​:05 <+camelia> ..rakudo-parrot e54ad4​: OUTPUT«===SORRY!=== Error while
  compiling /tmp/Ry4A8W96Ye␤Variable '$foo' is not declared␤at
  /tmp/Ry4A8W96Ye​:1␤------> $foo​::⏏ = 42; say $foo​::; # RT #
  76400␤ expecting any of​:␤ postfix␤»

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 28, 2014

From @usev6

We're back to the behaviour from 2011​:

$ perl6 -e '$foo​:: = 42; say $foo​::'
42

$ perl6-m -e 'say $foo​::'
(Any)

But I wonder whether this is really correct. The subject states that 'say $foo​::' should not parse and TimToadys remarks sound likewise​:

<p6eval> std 31559​: OUTPUT«ok 00​:01 111m␤»
<TimToady> I didn't expect that to work :)
<masak> std bug.
* TimToady bug
<TimToady> I'm not entirely sure how it parsed...
<TimToady> oh, morename allows a final :​: component, but that's not
quite what you want here
<TimToady> std​: $defeat-the-name-checker​::
<p6eval> std 31559​: OUTPUT«ok 00​:01 108m␤»

$ ./viv -e '$foo​::'
[...]
└─VAST​::statementlist, BEG​: 0, END​: 7
  ├─VAST​::statement, BEG​: 0, END​: 7
  │ └─VAST​::term__S_variable, BEG​: 0, END​: 6, SYM​: variable, _specific​: 1
  │ └─VAST​::variable, BEG​: 0, END​: 6
  │ ├─VAST​::sigil__S_Dollar, BEG​: 0, END​: 1, SYM​: $, TEXT​: $, _specific​: 1
  │ └─VAST​::desigilname, BEG​: 1, END​: 6
  │ └─VAST​::longname, BEG​: 1, END​: 6
  │ └─VAST​::name, BEG​: 1, END​: 6
  │ │ └─morename​: - !!perl/hash​:VAST​::morename
  │ │ BEG​: 4
  │ │ END​: 6
  │ │ EXPR​: []
  │ │ TEXT​: '​::'
  │ │ identifier​: []
  │ └─VAST​::identifier, BEG​: 1, END​: 4, TEXT​: foo
  └─VAST​::eat_terminator, BEG​: 7, END​: 7, TEXT​: , WS​: 1

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 28, 2014

From @usev6

We're back to the behaviour from 2011​:

$ perl6 -e '$foo​:: = 42; say $foo​::'
42

$ perl6-m -e 'say $foo​::'
(Any)

But I wonder whether this is really correct. The subject states that 'say $foo​::' should not parse and TimToadys remarks sound likewise​:

<p6eval> std 31559​: OUTPUT«ok 00​:01 111m␤»
<TimToady> I didn't expect that to work :)
<masak> std bug.
* TimToady bug
<TimToady> I'm not entirely sure how it parsed...
<TimToady> oh, morename allows a final :​: component, but that's not
quite what you want here
<TimToady> std​: $defeat-the-name-checker​::
<p6eval> std 31559​: OUTPUT«ok 00​:01 108m␤»

$ ./viv -e '$foo​::'
[...]
└─VAST​::statementlist, BEG​: 0, END​: 7
  ├─VAST​::statement, BEG​: 0, END​: 7
  │ └─VAST​::term__S_variable, BEG​: 0, END​: 6, SYM​: variable, _specific​: 1
  │ └─VAST​::variable, BEG​: 0, END​: 6
  │ ├─VAST​::sigil__S_Dollar, BEG​: 0, END​: 1, SYM​: $, TEXT​: $, _specific​: 1
  │ └─VAST​::desigilname, BEG​: 1, END​: 6
  │ └─VAST​::longname, BEG​: 1, END​: 6
  │ └─VAST​::name, BEG​: 1, END​: 6
  │ │ └─morename​: - !!perl/hash​:VAST​::morename
  │ │ BEG​: 4
  │ │ END​: 6
  │ │ EXPR​: []
  │ │ TEXT​: '​::'
  │ │ identifier​: []
  │ └─VAST​::identifier, BEG​: 1, END​: 4, TEXT​: foo
  └─VAST​::eat_terminator, BEG​: 7, END​: 7, TEXT​: , WS​: 1

@p6rt
Copy link
Author

p6rt commented Mar 8, 2015

From @Mouq

FWIW, it working with -e is a consequence of the implicit 'no strict'. Turning strict has what is probably a more correct result​:

$ perl6 -e 'use strict; $foo​:: = 42; say $foo​::'
===SORRY!=== Error while compiling -e
Variable '$foo' is not declared
at -e​:1
------> use strict; $foo​::⏏ = 42; say $foo​::
  expecting any of​:
  postfix
$ perl6 -e 'use strict; say $foo​::'
===SORRY!=== Error while compiling -e
Variable '$foo' is not declared
at -e​:1
------> use strict; say $foo​::⏏<EOL>
  expecting any of​:
  postfix

This is the correct behavior (dying, since $foo *wasn't* declared). Thus this is back to testneeded.

On Tue Oct 28 13​:47​:21 2014, bartolin@​gmx.de wrote​:

We're back to the behaviour from 2011​:

$ perl6 -e '$foo​:: = 42; say $foo​::'
42

$ perl6-m -e 'say $foo​::'
(Any)

But I wonder whether this is really correct. The subject states that
'say $foo​::' should not parse and TimToadys remarks sound likewise​:

<p6eval> std 31559​: OUTPUT«ok 00​:01 111m␤»
<TimToady> I didn't expect that to work :)
<masak> std bug.
* TimToady bug
<TimToady> I'm not entirely sure how it parsed...
<TimToady> oh, morename allows a final :​: component, but that's not
quite what you want here
<TimToady> std​: $defeat-the-name-checker​::
<p6eval> std 31559​: OUTPUT«ok 00​:01 108m␤»

$ ./viv -e '$foo​::'
[...]
└─VAST​::statementlist, BEG​: 0, END​: 7
├─VAST​::statement, BEG​: 0, END​: 7
│ └─VAST​::term__S_variable, BEG​: 0, END​: 6, SYM​: variable,
_specific​: 1
│ └─VAST​::variable, BEG​: 0, END​: 6
│ ├─VAST​::sigil__S_Dollar, BEG​: 0, END​: 1, SYM​: $, TEXT​: $,
_specific​: 1
│ └─VAST​::desigilname, BEG​: 1, END​: 6
│ └─VAST​::longname, BEG​: 1, END​: 6
│ └─VAST​::name, BEG​: 1, END​: 6
│ │ └─morename​: - !!perl/hash​:VAST​::morename
│ │ BEG​: 4
│ │ END​: 6
│ │ EXPR​: []
│ │ TEXT​: '​::'
│ │ identifier​: []
│ └─VAST​::identifier, BEG​: 1, END​: 4, TEXT​: foo
└─VAST​::eat_terminator, BEG​: 7, END​: 7, TEXT​: , WS​: 1

@p6rt
Copy link
Author

p6rt commented May 2, 2015

From @jdv

Added test to t/spec/S02-names/symbolic-deref.t

@p6rt
Copy link
Author

p6rt commented May 2, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant