• Joshua Litt's avatar
    [regexp] Clone match info for match indices. · dfd9ceb9
    Joshua Litt authored
    The current behavior for generating match indices simply stashes a
    pointer to the match info and then constructs the indices lazily.
    However, it turns out the match info object used to create the result
    object is the regexp_last_match_info living on native context, and thus
    it can change between the creation of the result object and the generation
    of indices. This cl clones the match info which will be safer.
    
    Bug: v8:9548
    Change-Id: Ia6f26f88fbc22fd09671bf4c579d39a1510b552d
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1864585
    Commit-Queue: Joshua Litt <joshualitt@chromium.org>
    Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#64356}
    dfd9ceb9
regexp-match-indices.js 2.35 KB