Dual-Life / Devel-PPPort

Perl/Pollution/Portability
9 stars 28 forks source link

3.54 breaks p5-Text-Xslate #140

Closed khwilliamson closed 5 years ago

khwilliamson commented 5 years ago

https://github.com/xslate/p5-Text-Xslate/issues/198

@pali can you look at this?

skaji commented 5 years ago

@khwilliamson Thanks.

P.S. If github is the preferred location for tickets, could you update bugtracker in META.json? https://github.com/Dual-Life/Devel-PPPort/blob/master/Makefile.PL#L89

pali commented 5 years ago

Can you try following patch?

diff --git a/parts/inc/Sv_set b/parts/inc/Sv_set
index 97533a6..abf4d31 100644
--- a/parts/inc/Sv_set
+++ b/parts/inc/Sv_set
@@ -25,15 +25,15 @@ sv_setsv_flags
 #if ( { VERSION >= 5.7.3 } && { VERSION < 5.8.7 } ) || ( { VERSION >= 5.9.0 } && { VERSION < 5.9.2 } )
 #undef sv_setsv_flags
 #define SV_NOSTEAL 16
-#define sv_setsv_flags(dstr, sstr, flags)                                \
-  STMT_START {                                                           \
-    if (((flags) & SV_NOSTEAL) && (SvFLAGS((sstr)) & SVs_TEMP)) {        \
-      SvTEMP_off((sstr));                                                \
-      Perl_sv_setsv_flags(aTHX_ (dstr), (sstr), (flags) & ~SV_NOSTEAL);  \
-      SvTEMP_on((sstr));                                                 \
-    } else {                                                             \
-      Perl_sv_setsv_flags(aTHX_ (dstr), (sstr), (flags) & ~SV_NOSTEAL);  \
-    }                                                                    \
+#define sv_setsv_flags(dstr, sstr, flags)                                          \
+  STMT_START {                                                                     \
+    if (((flags) & SV_NOSTEAL) && (sstr) && (SvFLAGS((SV *)(sstr)) & SVs_TEMP)) {  \
+      SvTEMP_off((SV *)(sstr));                                                    \
+      Perl_sv_setsv_flags(aTHX_ (dstr), (sstr), (flags) & ~SV_NOSTEAL);            \
+      SvTEMP_on((SV *)(sstr));                                                     \
+    } else {                                                                       \
+      Perl_sv_setsv_flags(aTHX_ (dstr), (sstr), (flags) & ~SV_NOSTEAL);            \
+    }                                                                              \
   } STMT_END
 #endif

@@ -160,6 +160,16 @@ newSVsv_nomg(sv)

 #endif

+void
+sv_setsv_compile_test(sv)
+        SV *sv
+        CODE:
+                sv_setsv(sv, NULL);
+                sv_setsv_flags(sv, NULL, 0);
+#ifdef SV_NOSTEAL
+                sv_setsv_flags(sv, NULL, SV_NOSTEAL);
+#endif
+
 =tests plan => 15

 my $foo = 5;

I forgot that sv_setsv_flags can have NULL as its second argument and then works like if &PL_sv_undef was passed.

skaji commented 5 years ago

@pali I confirmed that I could build Text::Xslate on perl 5.8.5 with your patch. Thanks.

pali commented 5 years ago

Ok, thank you for testing!

atoomic commented 5 years ago

@skaji I've submitted a proposal update for bug tracker urls https://github.com/Dual-Life/Devel-PPPort/pull/141

atoomic commented 5 years ago

@pali do you want me to submit your patch above? note: I just fixed the Makefile.PL for the development VERSION... 91191d306e83fed5b8f4d58e42a9ffacd4e1fce7

pali commented 5 years ago

Ok, you can do that.

atoomic commented 5 years ago

@pali just submitted let it smoke and fix a few other thing before planning on a release probably later today

pali commented 5 years ago

ok