|
6 | 6 | and semantics are as close as possible to those of the Perl 5 language. |
7 | 7 |
|
8 | 8 | Written by Philip Hazel |
9 | | - Copyright (c) 1997-2016 University of Cambridge |
| 9 | + Copyright (c) 1997-2018 University of Cambridge |
10 | 10 |
|
11 | 11 | ----------------------------------------------------------------------------- |
12 | 12 | Redistribution and use in source and binary forms, with or without |
@@ -3299,7 +3299,7 @@ for(;;) |
3299 | 3299 | if ((*xclass_flags & XCL_MAP) == 0) |
3300 | 3300 | { |
3301 | 3301 | /* No bits are set for characters < 256. */ |
3302 | | - if (list[1] == 0) return TRUE; |
| 3302 | + if (list[1] == 0) return (*xclass_flags & XCL_NOT) == 0; |
3303 | 3303 | /* Might be an empty repeat. */ |
3304 | 3304 | continue; |
3305 | 3305 | } |
@@ -7647,6 +7647,8 @@ for (;; ptr++) |
7647 | 7647 | /* Can't determine a first byte now */ |
7648 | 7648 |
|
7649 | 7649 | if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE; |
| 7650 | + zerofirstchar = firstchar; |
| 7651 | + zerofirstcharflags = firstcharflags; |
7650 | 7652 | continue; |
7651 | 7653 |
|
7652 | 7654 |
|
@@ -8687,10 +8689,18 @@ do { |
8687 | 8689 | if (!is_anchored(scode, new_map, cd, atomcount)) return FALSE; |
8688 | 8690 | } |
8689 | 8691 |
|
8690 | | - /* Positive forward assertions and conditions */ |
| 8692 | + /* Positive forward assertion */ |
8691 | 8693 |
|
8692 | | - else if (op == OP_ASSERT || op == OP_COND) |
| 8694 | + else if (op == OP_ASSERT) |
| 8695 | + { |
| 8696 | + if (!is_anchored(scode, bracket_map, cd, atomcount)) return FALSE; |
| 8697 | + } |
| 8698 | + |
| 8699 | + /* Condition; not anchored if no second branch */ |
| 8700 | + |
| 8701 | + else if (op == OP_COND) |
8693 | 8702 | { |
| 8703 | + if (scode[GET(scode,1)] != OP_ALT) return FALSE; |
8694 | 8704 | if (!is_anchored(scode, bracket_map, cd, atomcount)) return FALSE; |
8695 | 8705 | } |
8696 | 8706 |
|
|
0 commit comments