In perl.git, the branch blead has been updated <https://perl5.git.perl.org/perl.git/commitdiff/de59f38ed9c2eb88d97eed5f7ade475479bc3248?hp=e14197aa126e873114b4bb8628ed7afa87557457>
- Log ----------------------------------------------------------------- commit de59f38ed9c2eb88d97eed5f7ade475479bc3248 Author: Karl Williamson <[email protected]> Date: Wed Feb 27 15:09:07 2019 -0700 Fix dup_warnings() It turns out that some Configure options cause this to be called with a NULL parameter. (I didn't check, but my guess is it's threaded builds.) That means that the embed.fnc entry should be NULLOK for the parameter. And that means that embed.fnc doesn't generate an ARGS_ASSERT macro, so that should be removed from the function. (I actually think it should generate an empty ARGS_ASSERT that could be included or not, so that code wouldn't have to change if a parameter became required to be non-null or vice versa. The porting test would only check for non-empty macros being present. But this is for another day.) The reason it works as-was with a NULL parameter is because of an apparent coincidence: specialWARN() is called first thing in this function and thinks a NULL is a defined marker for a particular meaning, so the function immediately returns. This commit makes that explicit rather than relying on the apparent coincidence. ----------------------------------------------------------------------- Summary of changes: embed.fnc | 2 +- op.c | 4 +--- proto.h | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/embed.fnc b/embed.fnc index 4b33a681c6..2f8dd63487 100644 --- a/embed.fnc +++ b/embed.fnc @@ -3279,6 +3279,6 @@ XEop |void |dtrace_probe_op |NN const OP *op XEop |void |dtrace_probe_phase|enum perl_phase phase #endif -XEop |STRLEN*|dup_warnings |NN STRLEN* warnings +XEop |STRLEN*|dup_warnings |NULLOK STRLEN* warnings : ex: set ts=8 sts=4 sw=4 noet: diff --git a/op.c b/op.c index 11f84e7957..75d25f3e7d 100644 --- a/op.c +++ b/op.c @@ -17053,9 +17053,7 @@ Perl_dup_warnings(pTHX_ STRLEN* warnings) Size_t size; STRLEN *new_warnings; - PERL_ARGS_ASSERT_DUP_WARNINGS; - - if (specialWARN(warnings)) + if (warnings == NULL || specialWARN(warnings)) return warnings; size = sizeof(*warnings) + *warnings; diff --git a/proto.h b/proto.h index 64ec373683..500c5813c6 100644 --- a/proto.h +++ b/proto.h @@ -900,8 +900,6 @@ PERL_CALLCONV void Perl_dump_vindent(pTHX_ I32 level, PerlIO *file, const char* #define PERL_ARGS_ASSERT_DUMP_VINDENT \ assert(file); assert(pat) PERL_CALLCONV STRLEN* Perl_dup_warnings(pTHX_ STRLEN* warnings); -#define PERL_ARGS_ASSERT_DUP_WARNINGS \ - assert(warnings) PERL_CALLCONV void Perl_emulate_cop_io(pTHX_ const COP *const c, SV *const sv); #define PERL_ARGS_ASSERT_EMULATE_COP_IO \ assert(c); assert(sv) -- Perl5 Master Repository
