Commit 725e7d4
committed
MY_CXT: don't SEGV on a 1-byte struct.
The MY_CXT mechanism allows XS code to declare a 'static' struct
which is actually per-interpreter. Behind the scenes, the memory for
this struct is allocated as the PVX buf of an SV. If the size of the
struct is 1 (e.g. '{ char foo }' ) then newSV(size-1) gets called
as newSV(0), which skips allocating a PVX buffer. SEGVs ensue.1 parent e8bbad6 commit 725e7d4
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5491 | 5491 | | |
5492 | 5492 | | |
5493 | 5493 | | |
5494 | | - | |
5495 | | - | |
| 5494 | + | |
| 5495 | + | |
| 5496 | + | |
5496 | 5497 | | |
5497 | 5498 | | |
5498 | 5499 | | |
| |||
0 commit comments