Ticket #1510 (assigned bug)

Opened 4 years ago

Last modified 3 years ago

NQP-rx doesn't create PMC for string // expressions

Reported by: Austin_Hastings Owned by: pmichaud
Priority: normal Milestone:
Component: nqp Version: 2.1.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

austin@andLinux:~/kakapo$ cat test.nqp

my %hash;
%hash<key> := 1;

#my $x := ~ %hash<key>;
my $y := ~ %hash<key> // 'r';

Produces:

austin@andLinux:~/kakapo$ parrot-nqp test.nqp
Null PMC access in set_string_native()
current instr.: '_block11' pc 0 (EVAL_1:6)
called from Sub 'parrot;PCT;HLLCompiler;eval' pc -1 ((unknown file):-1)
called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1303 (compilers/pct/src/PCT/HLLCompiler.pir:707)
called from Sub 'parrot;PCT;HLLCompiler;command_line' pc 1489 (compilers/pct/src/PCT/HLLCompiler.pir:794)
called from Sub 'parrot;NQP;Compiler;main' pc -1 ((unknown file):-1)
austin@andLinux:~/kakapo$ 

The bad part of the code seems to be:

    vivify_13:
    set $S21, $P20
    set $P18, $S21
    defined $I23, $P18
    if $I23, default_22
    new $P24, "String"
    assign $P24, "r"
    set $P18, $P24

Note here the use of $P18, which has never been initialized.

Change History

Changed 4 years ago by jkeenan

  • owner set to pmichaud
  • component changed from none to nqp

Changed 3 years ago by pmichaud

  • status changed from new to assigned

This is a bug in PAST::Compiler's "def_or" method -- for some reason it's correctly coercing the result of prefix:<~> into something that it can test using the 'defined' opcode.

Will look into this a bit further shortly.

Pm

Note: See TracTickets for help on using tickets.