• Iain Ireland's avatar
    [regexp] Cache min/max-match for RegExpCapture/Group · 9b5141ca
    Iain Ireland authored
    Unlike the other RegExpTree types, RegExpCapture and RegExpGroup don't
    cache their min/maxMatch value. Instead, they compute it by recursing
    on the min/maxMatch of the body node. In pathological cases, with
    sufficiently small stacks, this can cause stack overflow. (In
    SpiderMonkey's case, it was a worker on 32-bit x86.)
    
    It's easy enough to just precompute the value when the body is set.
    
    R=jgruber@chromium.org
    
    Bug: v8:10303
    Change-Id: I4ba3d301d9a4a3f3c0cb94966148b747a4092d26
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2090192
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#66673}
    9b5141ca
regexp-ast.h 21.3 KB