Some places where the new opcode OP_COMMIT_ARG needs to be handled and which I

forgot.
This commit is contained in:
Philip.Hazel 2018-07-21 14:52:26 +00:00
parent 192b82cf6e
commit 5ea9f6b0f1
6 changed files with 19 additions and 4 deletions

View File

@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016 University of Cambridge
New API code Copyright (c) 2016-2018 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@ -131,6 +131,7 @@ for (;;)
break;
case OP_MARK:
case OP_COMMIT_ARG:
case OP_PRUNE_ARG:
case OP_SKIP_ARG:
case OP_THEN_ARG:

View File

@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2017 University of Cambridge
New API code Copyright (c) 2016-2018 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@ -390,6 +390,7 @@ while (TRUE)
#endif
case OP_MARK:
case OP_COMMIT_ARG:
case OP_PRUNE_ARG:
case OP_SKIP_ARG:
case OP_THEN_ARG:

View File

@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2017 University of Cambridge
New API code Copyright (c) 2016-2018 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@ -799,6 +799,7 @@ for(;;)
break;
case OP_MARK:
case OP_COMMIT_ARG:
case OP_PRUNE_ARG:
case OP_SKIP_ARG:
case OP_THEN_ARG:

View File

@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2017 University of Cambridge
New API code Copyright (c) 2016-2018 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@ -707,6 +707,7 @@ for (;;)
/* Skip these, but we need to add in the name length. */
case OP_MARK:
case OP_COMMIT_ARG:
case OP_PRUNE_ARG:
case OP_SKIP_ARG:
case OP_THEN_ARG:
@ -956,6 +957,7 @@ do
case OP_CIRCM:
case OP_CLOSE:
case OP_COMMIT:
case OP_COMMIT_ARG:
case OP_COND:
case OP_CREF:
case OP_FALSE:

2
testdata/testinput2 vendored
View File

@ -2949,6 +2949,8 @@
/abc(*:)pqr/
/(*COMMIT:X)/B
# This should, and does, fail. In Perl, it does not, which I think is a
# bug because replacing the B in the pattern by (B|D) does make it fail.
# Turning off Perl's optimization by inserting (??{""}) also makes it fail.

View File

@ -10154,6 +10154,14 @@ Failed: error 166 at offset 10: (*MARK) must have an argument
/abc(*:)pqr/
Failed: error 166 at offset 6: (*MARK) must have an argument
/(*COMMIT:X)/B
------------------------------------------------------------------
Bra
*COMMIT X
Ket
End
------------------------------------------------------------------
# This should, and does, fail. In Perl, it does not, which I think is a
# bug because replacing the B in the pattern by (B|D) does make it fail.
# Turning off Perl's optimization by inserting (??{""}) also makes it fail.