Patch from Enache for the crashing of bytecode.t in Tru64.
[p5sagit/p5-mst-13.2.git] / ext / ByteLoader / bytecode.h
index bd62b28..8ca9382 100644 (file)
@@ -171,12 +171,17 @@ typedef char *pvindex;
 
 
 #define BSET_newsv(sv, arg)                            \
-       STMT_START {                                    \
-           sv = (arg == SVt_PVAV ? (SV*)newAV() :      \
-                 arg == SVt_PVHV ? (SV*)newHV() :      \
-                 NEWSV(666,0));                        \
-           SvUPGRADE(sv, arg);                         \
-       } STMT_END
+           switch(arg) {                               \
+           case SVt_PVAV:                              \
+               sv = (SV*)newAV();                      \
+               break;                                  \
+           case SVt_PVHV:                              \
+               sv = (SV*)newHV();                      \
+               break;                                  \
+           default:                                    \
+               sv = NEWSV(0,0);                        \
+               SvUPGRADE(sv, (arg));                   \
+           }
 #define BSET_newsvx(sv, arg) STMT_START {              \
            BSET_newsv(sv, arg &  SVTYPEMASK);          \
            SvFLAGS(sv) = arg;                          \
@@ -372,8 +377,4 @@ typedef char *pvindex;
            if (sz != PTRSIZE) {                                \
                HEADER_FAIL("different PTRSIZE");               \
            }                                                   \
-           BGET_strconst(str); /* byteorder */                 \
-           if (strNE(str, STRINGIFY(BYTEORDER))) {             \
-               HEADER_FAIL("different byteorder");     \
-           }                                                   \
        } STMT_END