File: 0001-Fix-a-pad-problem-with-Perl-5.21.4-on-threaded-build.patch

package info (click to toggle)
libdevel-callparser-perl 0.002-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 292 kB
  • sloc: perl: 73; sh: 4; makefile: 3
file content (45 lines) | stat: -rw-r--r-- 1,428 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Description: Fix a pad problem with Perl >= 5.21.4 on threaded builds
 This broke at least the Kavorka and Moops distributions.
Author: Niko Tyni <ntyni@debian.org>
Bug: https://rt.cpan.org/Public/Bug/Display.html?id=110623
Bug-Debian: https://bugs.debian.org/808826
Last-Update: 2017-06-27

--- a/lib/Devel/CallParser.xs
+++ b/lib/Devel/CallParser.xs
@@ -323,10 +323,14 @@
 	 * The core bug was supposedly fixed in Perl 5.19.4, but actually
 	 * that version exhibits a different bug also apparently related
 	 * to padrange.  Restoring the pad's fill pointer works around
-	 * this bug too.  So for now this workaround is used with no
-	 * upper bound on the Perl version.
+	 * this bug too.
+	 *
+	 * The other padrange bug was fixed in Perl 5.19.5 (commit aa033da),
+	 * so the workaround is no longer needed after that, but it remains
+	 * harmless until v5.21.4 (commit c9859fb)  where it starts breaking
+	 * (see t/pad2.t.)
 	 */
-#define MUST_RESTORE_PAD_FILL PERL_VERSION_GE(5,17,6)
+#define MUST_RESTORE_PAD_FILL PERL_VERSION_GE(5,17,6) && ! PERL_VERSION_GE(5,19,5)
 #if MUST_RESTORE_PAD_FILL
 	I32 padfill = av_len(PL_comppad);
 #endif /* MUST_RESTORE_PAD_FILL */
--- /dev/null
+++ b/t/pad2.t
@@ -0,0 +1,15 @@
+use warnings;
+use strict;
+
+use Test::More tests => 1;
+
+use Devel::CallParser;
+
+sub f {
+  my $arg = shift;
+
+  { my $arg; } # ???
+  ok($arg, '$arg stays set after a "my $arg" block');
+}
+
+f(1);