• Jakob Gruber's avatar
    [regexp] Only emit valid ranges in MakeRangeArray · b7dc9915
    Jakob Gruber authored
    Character class handling in the irregexp pipeline is quite complex;
    codepoints outside the BMP (basic multilingual plane) are only
    translated into surrogate pairs when needed, e.g. when the subject
    string is two-byte. If not needed, the codepoints simply stay part of
    the list of CharacterRanges.
    
    In EmitCharClass, we determine the valid subset of ranges through
    ranges_length; until this CL, we forgot to pass that information on to
    MakeRangeArray. Do that now by truncating the list of CharacterRanges.
    
    Fixed: chromium:1262423
    Change-Id: I5bb5b839e9935890ca2d10908ad66d72c3217178
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3240782
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Auto-Submit: Jakob Gruber <jgruber@chromium.org>
    Reviewed-by: 's avatarMathias Bynens <mathias@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#77514}
    b7dc9915
regress-1262423.js 241 Bytes