From 4a0c7558cb3dad795591b57e712bedba39bc1c84 Mon Sep 17 00:00:00 2001 From: Hugo van der Sanden Date: Sun, 15 Feb 2015 11:44:00 +0000 Subject: [perl #123843] fix SEGV reading data->flags This could be triggered by trying to compile eg 'qr{x+(y(?0))*}'. --- t/re/pat.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 't/re') diff --git a/t/re/pat.t b/t/re/pat.t index ddfaebc651..137a049489 100644 --- a/t/re/pat.t +++ b/t/re/pat.t @@ -22,7 +22,7 @@ BEGIN { skip_all_without_unicode_tables(); } -plan tests => 770; # Update this when adding/deleting tests. +plan tests => 772; # Update this when adding/deleting tests. run_tests() unless caller; @@ -1676,6 +1676,14 @@ EOP fresh_perl_is($code, "No infinite loop here!", {}, "test that we handle things like m/\\888888888/ without infinite loops" ); } + + { + # [perl #123843] hits SEGV trying to compile this pattern + my $match; + eval q{ ($match) = ("xxyxxyxy" =~ m{(x+(y(?1))*)}) }; + ok(1, "compiled GOSUB in CURLYM ok"); + is($match, 'xxyxxyx', "matched GOSUB in CURLYM"); + } } # End of sub run_tests 1; -- cgit v1.2.1