File: 0001-Fix-non-deterministic-failures-on-newer-perls.patch

package info (click to toggle)
libb-perlreq-perl 0.82-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid
  • size: 700 kB
  • ctags: 909
  • sloc: perl: 1,090; sh: 69; makefile: 11
file content (39 lines) | stat: -rw-r--r-- 1,306 bytes parent folder | download
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
Bug: https://rt.cpan.org/Public/Bug/Display.html?id=85412
Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=85412
Bug-Debian: https://bugs.debian.org/708592

From 428c3feac1e9c39f966cc66c36cc3881d202177c Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Sat, 18 May 2013 09:41:47 +0300
Subject: [PATCH] Fix non-deterministic failures on newer perls

The hash randomization changes in the Perl 5.17 series
made perl.req to occasionally fail to report the dependencies.

Improved diagnostics report

 Use of each() on hash after insertion without resetting hash
 iterator results in undefined behavior, Perl interpreter: 0x9e7010 at
 /home/niko/tmp/libb-perlreq-perl-0.82/blib/lib/B/Walker.pm line 122.

so use keys() instead of each(), as suggested by perldiag.pod.
---
 lib/B/Walker.pm |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/B/Walker.pm b/lib/B/Walker.pm
index b71f204..f626043 100644
--- a/lib/B/Walker.pm
+++ b/lib/B/Walker.pm
@@ -119,7 +119,7 @@ sub walk_gv ($) {
 sub walk_stash ($$);
 sub walk_stash ($$) { # similar to B::walksymtable
 	my ($symref, $prefix) = @_;
-	while (my ($sym) = each %$symref) {
+	for my $sym (keys %$symref) {
 		no strict 'refs';
 		my $fullname = "*main::". $prefix . $sym;
 		if ($sym =~ /::\z/) {
-- 
1.7.10.4