Mailing List Archive

Found it! GIMME binary incompatibility is actually a -DDEBUGGING issue
This struck me in the early hours of the morning whilst trying to get some
sleep on the Swansea-Cork ferry returning from a few days break in Ireland!
(I had just about managed to spend four days without thinking about perl :-)

The GIMME macro is broken when used in an extension built with a different
-DDEBUGGING setting than the perl it is loaded into.

Here's the patch:

diff -c ./op.h.1n ./op.h
*** ./op.h.1n Tue Nov 7 17:51:24 1995
--- ./op.h Tue Nov 7 17:52:51 1995
***************
*** 36,45 ****
OP* op_sibling; \
OP* (*op_ppaddr)(); \
PADOFFSET op_targ; \
- OPCODE op_type; \
U16 op_seq; \
U8 op_flags; \
! U8 op_private;

#define GIMME (op->op_flags & OPf_KNOW ? op->op_flags & OPf_LIST : dowantarray())

--- 36,45 ----
OP* op_sibling; \
OP* (*op_ppaddr)(); \
PADOFFSET op_targ; \
U16 op_seq; \
U8 op_flags; \
! U8 op_private; \
! OPCODE op_type;

#define GIMME (op->op_flags & OPf_KNOW ? op->op_flags & OPf_LIST : dowantarray())


Basically the code generated for op->op_flags in the GIMME macro in an
extension will not refer to the op_flags field in the structure in perl
if the size of OPCODE type differs (which it does with -DDEBUGGING).

The patch simply moves the variable sized op_type field to the end of
the common BASEOP fields, thus making op_seq, op_flags and op_private
binary compatible across -DDEBUGGING settings.

Note that this will require _all_ extensions to be rebuilt but that's
a small pain compared to the grief that people will through trying to
track down the symptoms of this. I know, I've been there!

Tim.


P.s. This bounced when I sent it to perlbug@perl.com:
'perlbug@perl.com (host: perl.com) (queue: smtpns)' for the following
reason: ' <perlbug@perl.com>... User unknown'