#1514: NQP-rx doesn't check storage mode for contextuals
-----------------------------+----------------------------------------------
Reporter: Austin_Hastings | Owner: pmichaud
Type: bug | Status: new
Priority: normal | Milestone:
Component: nqp | Version: 2.2.0
Severity: medium | Keywords:
Lang: | Patch:
Platform: |
-----------------------------+----------------------------------------------
Reading from a contextual ($*foo) variable checks for a dynamic lexical,
and if none is found tries reading from a global in the HLL-root
namespace.
Storing, however, does not check, and so an attempt to store to $*foo will
die if no dynamic lexical is found with the right name - storing to the
global is never considered.
{{{
$*foo := 1;
say($*foo);
}}}
produces this code:
{{{
.annotate "line", 1
new $P13, "Integer"
assign $P13, 1
store_dynamic_lex "$*foo", $P13
.annotate "line", 3
find_dynamic_lex $P14, "$*foo"
unless_null $P14, vivify_11
get_hll_global $P14, "$foo"
unless_null $P14, vivify_12
die "Contextual $*foo not found"
}}}
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/1514>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets