develooper Front page | perl.perl6.internals | Postings from September 2005

Re: [perl #37045] Trace Displays Wrong Substr in Hash Key

Thread Previous | Thread Next
From:
Nick Glencross
Date:
September 2, 2005 15:20
Subject:
Re: [perl #37045] Trace Displays Wrong Substr in Hash Key
Message ID:
4318D01C.2010306@glencros.demon.co.uk
Matt Diephouse (via RT) wrote:

># New Ticket Created by  Matt Diephouse 
># Please include the string:  [perl #37045]
># in the subject line of all future correspondence about this issue. 
># <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=37045 >
>
>
>In the key below, S15 shows up as "he", even though it is really "ll":
>
>   harmony:~/Projects/parrot mdiep$ cat test.pir
>   .sub main @MAIN
>     $P0 = new Hash
>     $S0 = "hello world"
>     $S1 = substr $S0, 2, 2
>     $S1 .= ""
>     $I0 = exists $P0[$S1]
>     end
>   .end
>   harmony:~/Projects/parrot mdiep$ parrot -tf test.pir
>        0 new P30, 51      - P30=PMCNULL,
>        3 set S30, "hello world"   - ,
>        6 substr S15, S30, 2, 2    - , S30="hello world", ,
>       11 concat S15, ""   - S15="ll",
>       14 exists I30, P30[S15="he"]        - I30=0, P30=Hash=PMC 
>(0xe4e230),
>       18 end
>

Looks to me like it's a problem with the tracing, which should be fixed 
by this patch.

There's similar code for constant string keys, but I think that these 
will always be safely anchored at the string start.

Nick


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About