in reply to Re: [I::C] Why does it segfault? (NDEBUG?)
in thread [I::C] Why does it segfault?
you do nothing to upgrade the bare SV to be of sufficient type to hold a PV
According to the docs:
newSV
Creates a new SV. A non-zero len parameter indicates the number of bytes of preallocated string space the SV should have. An extra byte for a trailing NUL is also reserved. (SvPOK is not set for the SV even if string space is allocated.) The reference count for the new SV is set to 1.
Which kind of implies that it creates a PV-type SV -- given that it offers to preallocate some space to the PV.
But I guess that it just fails to mention that if you give a zero parameter, not only does it not preallocate the space, it doesn't allocate the PV-type fields either :(
perhaps you are building in an environment that doesn't have assert()s enabled.
You're right. I had the session configured for /release instead of /debug.
the ref you return on the stack is not mortalized
I believe I::C will take care of that for me.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: [I::C] Why does it segfault? (NDEBUG?)
by tye (Sage) on Mar 15, 2012 at 13:49 UTC | |
|
Re^3: [I::C] Why does it segfault? (NDEBUG?)
by ikegami (Patriarch) on Mar 16, 2012 at 19:53 UTC |