Craig Barratt wrote:
>   - This (unusual) sequence causes a seg fault:
>         [% x = [1]; x.y.z = 2; %]
>     (The perl Stash.pm ignores the illegal lvalue.)

I didn't get a segfault, but the XS version does indeed croak:

  undef error - don't know how to assign to [ (null) ].z

Something's weird there, so I've added more checks for null pointers
that seem to help. Interestingly, the original perl Stash.pm dies with
this template:

  [% x = [1]; x.y = 2; %]
  undef error - don't know how to assign to [ARRAY(0x82fe478)].[y]

while the XS version now silently does nothing.


>   - Around line 554 of Stash.xs, should "len > 1" really be "len >= 1"?
>     (However, I wasn't able to create an example that showed different
>     behavior to Stash.pm.)

 That block of code was ''off by one'' because av_len() returns the
highest index (like $#array), rather then the length of the array. I
also think that particular die_object() case may be handled earlier by
fold_results(). 

 Thanks for pointing out these problems. I've attached an improved
version.

 - doug

Attachment: TT-2.04-XS-b.tar.gz
Description: GNU Zip compressed data

Reply via email to