Ticket #1514 (closed bug: invalid)
NQP-rx doesn't check storage mode for contextuals
Reported by: | Austin_Hastings | Owned by: | pmichaud |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | nqp | Version: | 2.2.0 |
Severity: | medium | Keywords: | |
Cc: | Language: | ||
Patch status: | Platform: |
Description
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"
Change History
Note: See
TracTickets for help on using
tickets.