Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Issue 8554004: Catch non-string subject in RegExpExecStub. (Closed)

Created:
9 years, 1 month ago by Yang
Modified:
9 years, 1 month ago
Reviewers:
Lasse Reichstein
CC:
v8-dev
Visibility:
Public.

Description

Catch non-string subject in RegExpExecStub. There is no test case to trigger any crash. This is only to guard against the case that the native function is called with unsafe arguments. Committed: http://code.google.com/p/v8/source/detail?r=10064

Patch Set 1 #

Total comments: 2

Patch Set 2 : Small changes. #

Patch Set 3 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -0 lines) Patch
M src/arm/code-stubs-arm.cc View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M src/ia32/code-stubs-ia32.cc View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M src/x64/code-stubs-x64.cc View 1 2 2 chunks +7 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Yang
Please take a look. This patch adds a guard against non-string subjects when executing regexp ...
9 years, 1 month ago (2011-11-21 14:27:35 UTC) #1
Yang
On 2011/11/21 14:27:35, Yang wrote: > Please take a look. > > This patch adds ...
9 years, 1 month ago (2011-11-23 14:17:09 UTC) #2
Lasse Reichstein
I'm not sure this is the correct place to put the safeguard. If nothing else, ...
9 years, 1 month ago (2011-11-24 09:31:57 UTC) #3
Yang
On 2011/11/24 09:31:57, Lasse Reichstein wrote: > I'm not sure this is the correct place ...
9 years, 1 month ago (2011-11-24 15:02:10 UTC) #4
Lasse Reichstein
9 years, 1 month ago (2011-11-24 17:08:35 UTC) #5
The previous checks indeed, subtly, include the kNotStringTag bit in the
comparison, and should be safe. If doing it this way, at least put a comment
explaining that the lt(r1, ...) comparison can't succeed if the object is a
non-string.

Apart from that, the optimal (IMO) place to check for the input being a string
is in the code for %_RegExpExec, not in the stub that it happens to call.

In either case, LGTM.

Powered by Google App Engine
This is Rietveld 408576698