diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-03-05 18:14:47 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-03-05 18:14:47 +0000 |
commit | 59d6f6a4c05afa7f69dc616d7a7f7446ceb5433a (patch) | |
tree | 4fcd0d4434cb6e6f016fd87450f6a2df9a602c3f /embed.h | |
parent | 816005240f1a3b9989c940e630e829048597537c (diff) | |
download | perl-59d6f6a4c05afa7f69dc616d7a7f7446ceb5433a.tar.gz |
Avoid miniperl SEGVing when processing -I on the #! line
A side-effect of change 3185893b8dec1062 was to force av in S_incpush() to be
NULL, whilst other flag variables were still set as if it were non-NULL, for
certain cases, only when compiled with -DPERL_IS_MINIPERL
The "obvious" fix is to also set all the flag variables to 0 under
-DPERL_IS_MINIPERL, to make everything consistent. However, this confuses (at
least) the local version of gcc, which issues warnings about passing a NULL
value (av, known always to be NULL) as a not-NULL parameter, despite the fact
that all the relevant calls are inside blocks which are actually dead code,
due to the if() conditions being const variables set to 0 under
-DPERL_IS_MINIPERL.
So to avoid future bug reports about compiler warnings, the least worst thing
to do seems to be to use #ifndef to use the pre-processor to eliminate the
dead code, and related variables.
Diffstat (limited to 'embed.h')
-rw-r--r-- | embed.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1190,6 +1190,11 @@ #define doopen_pm(a) S_doopen_pm(aTHX_ a) # endif # endif +# if !defined(PERL_IS_MINIPERL) +# if defined(PERL_IN_PERL_C) +#define incpush_if_exists(a,b,c) S_incpush_if_exists(aTHX_ a,b,c) +# endif +# endif # if !defined(PERL_NO_UTF16_FILTER) # if defined(PERL_IN_TOKE_C) #define add_utf16_textfilter(a,b) S_add_utf16_textfilter(aTHX_ a,b) @@ -1358,7 +1363,6 @@ #define find_beginning(a,b) S_find_beginning(aTHX_ a,b) #define forbid_setid(a,b) S_forbid_setid(aTHX_ a,b) #define incpush(a,b,c) S_incpush(aTHX_ a,b,c) -#define incpush_if_exists(a,b,c) S_incpush_if_exists(aTHX_ a,b,c) #define incpush_use_sep(a,b,c) S_incpush_use_sep(aTHX_ a,b,c) #define init_ids() S_init_ids(aTHX) #define init_interp() S_init_interp(aTHX) |