• jgruber's avatar
    [string] Fix regexp fast path in MaybeCallFunctionAtSymbol · 55a98076
    jgruber authored
    The regexp fast path in MaybeCallFunctionAtSymbol had an issue in which
    we'd call ToString after checking that the given {object} was a fast
    regexp and deciding to take the fast path. This is invalid since
    ToString() can call into user-controlled JS and may mutate {object}.
    
    There's no way to place the ToString call correctly in this instance:
    1 before BranchIfFastRegExp, it's a spec violation if we end up on the
      slow regexp path;
    2 the problem with the current location is already described above;
    3 and we can't place it into the fast-path regexp builtin (e.g.
      RegExpReplace) either due to the same reasons as 1.
    
    The solution in this CL is to restrict the fast path to string
    arguments only, i.e. cases where ToString would be a nop and can safely
    be skipped.
    
    Bug: chromium:782145
    Change-Id: Ifd35b3a9a6cf2e77c96cb860a8ec98eaec35aa85
    Reviewed-on: https://chromium-review.googlesource.com/758257
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#49213}
    55a98076
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
docs Loading commit data...
gni Loading commit data...
gypfiles Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.editorconfig Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm 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...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...