• marja's avatar
    RegExpParser: Fix Reset()ting to the end. · 978f41a1
    marja authored
    The bug would occur when we try to Reset() to a position already at the end.
    
    This happens e.g., when the regexp ends with \u. What used to happen in that
    case: 1) Advance past \ and u (to the end) (which wouldn't increase next_pos_
    enough) 2) Try to parse 4 hex digits 3) When that failed, Reset() to the
    position which should've been at the end but wasn't.
    
    To be able to properly Reset() to a position at the end, we need to allow
    next_pos_ to move beyond the end (since position() is next_pos_ - 1).
    
    Minimal repro case:
    
    var r = /foo\u/
    r.test("foou") // should be true, was false.
    
    (Note that \u not followed by 4 hex didits should be interpreted as an identity
    escape. It already worked unless \u was at the end of the regexp.)
    
    BUG=v8:3756
    LOG=NO
    
    Review URL: https://codereview.chromium.org/802313003
    
    Cr-Commit-Position: refs/heads/master@{#25838}
    978f41a1
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
include Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
Makefile.nacl Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...