Yes, exactly. A segfault from Perl means a bug in Perl (unless you did something nasty with the "p"/"P" formats of unpack) or a bug in an XS module.
The "correct" behavior for the above code is to undef @h but not to free the elements previously stored in @h until they are no longer on the stack. Pushing the elements onto the stacks should increment the reference count of the elements and "mortalize" them (such that the reference counts are decremented at the next sync point which will be after that part of the stack has been discarded).
This should be reported to p5p (though checking the bug database first would be polite). I'll be interested to see the disection of it. It may be an intentional "hole" for the sake of speed, but at this point I doubt it.
- tye (but my friends call me "Tye")In reply to (tye)Re: Segfaulty
by tye
in thread Segfaulty
by MeowChow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |