Skip to content

Commit 9ea31a2

Browse files
committed
What if we merged 23922 into blead, then 23782
This branch explores the question: What if we accept Matt Horsfall's suggested revision in pp_ctl.c (GH Perl#23922) into blead, then accept the goto-label-fatal branch underlying p.r. GH Perl#23782 into blead? Once a couple of merge conflicts were revised, the result would configure and build but would fail two test files: op/goto.t (Wstat: 0 Tests: 75 Failed: 23) Failed tests: 53-75 uni/labels.t (Wstat: 0 Tests: 11 Failed: 1) Failed test: 10 The failures in t/op/goto.t would be not at all surprising. Those tests are tests which currently pass in blead but which would fail if the code changes in pp_ctl.c in 23782 were directly merged into blead. I first deleted those tests from t/op/goto.t, then added them back in so that we would have a tally of the ways in which 'goto LABEL' would *no longer* work. So if we first merged 23922, we would presumably re-work those 23 test to pass in an informative way. I'll need to look further into t/uni/labels.t.
2 parents 8493142 + 2dedea3 commit 9ea31a2

File tree

6 files changed

+300
-360
lines changed

6 files changed

+300
-360
lines changed

pod/perldiag.pod

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7918,6 +7918,10 @@ For speed and efficiency reasons, Perl internally does not do full
79187918
reference-counting of iterated items, hence deleting such an item in the
79197919
middle of an iteration causes Perl to see a freed value.
79207920

7921+
=item Use of "goto" to jump into a construct is no longer permitted
7922+
7923+
(F) More TO COME.
7924+
79217925
=item Use of /g modifier is meaningless in split
79227926

79237927
(W regexp) You used the /g modifier on the pattern for a C<split>

t/comp/package_block.t

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!./perl
22

3-
print "1..7\n";
3+
print "1..5\n";
44

55
$main::result = "";
66
eval q{
@@ -56,37 +56,4 @@ eval q{
5656
};
5757
print $main::result eq "a(2)b(4)c(6)d(8)e(10)f(12)" ? "ok 5\n" : "not ok 5\n";
5858

59-
$main::result = "";
60-
$main::warning = "";
61-
$SIG{__WARN__} = sub { $main::warning .= $_[0]; };
62-
eval q{
63-
$main::result .= "a(".__PACKAGE__."/".eval("__PACKAGE__").")";
64-
goto l0;
65-
$main::result .= "b(".__PACKAGE__."/".eval("__PACKAGE__").")";
66-
package Foo {
67-
$main::result .= "c(".__PACKAGE__."/".eval("__PACKAGE__").")";
68-
l0:
69-
$main::result .= "d(".__PACKAGE__."/".eval("__PACKAGE__").")";
70-
goto l1;
71-
$main::result .= "e(".__PACKAGE__."/".eval("__PACKAGE__").")";
72-
}
73-
$main::result .= "f(".__PACKAGE__."/".eval("__PACKAGE__").")";
74-
l1:
75-
$main::result .= "g(".__PACKAGE__."/".eval("__PACKAGE__").")";
76-
goto l2;
77-
$main::result .= "h(".__PACKAGE__."/".eval("__PACKAGE__").")";
78-
package Bar {
79-
l2:
80-
$main::result .= "i(".__PACKAGE__."/".eval("__PACKAGE__").")";
81-
}
82-
$main::result .= "j(".__PACKAGE__."/".eval("__PACKAGE__").")";
83-
};
84-
print $main::result eq
85-
"a(main/main)d(Foo/Foo)g(main/main)i(Bar/Bar)j(main/main)" ?
86-
"ok 6\n" : "not ok 6\n";
87-
print $main::warning =~ /\A
88-
Use\ of\ "goto"\ [^\n]*\ line\ 3\.\n
89-
Use\ of\ "goto"\ [^\n]*\ line\ 15\.\n
90-
\z/x ? "ok 7\n" : "not ok 7\n";
91-
9259
1;

t/op/eval.t

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,13 @@ is(do {
224224
# (BUG ID 20010305.003 (#5963))
225225
{
226226
eval {
227-
eval { goto foo; };
228-
like($@, qr/Can't "goto" into the middle of a foreach loop/,
229-
'eval catches bad goto calls');
230-
last;
231-
foreach my $i (1) {
232-
foo: fail('jumped into foreach');
233-
}
227+
eval { goto foo; };
228+
like($@, qr/Can't "goto" into the middle of a foreach loop/,
229+
'eval catches bad goto calls');
230+
last;
231+
foreach my $i (1) {
232+
foo: fail('jumped into foreach');
233+
}
234234
};
235235
fail("Outer eval didn't execute the last");
236236
diag($@);

0 commit comments

Comments
 (0)