WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
129466
indexOf and lastIndexOf shouldn't resolve ropes when needle is longer than haystack
https://bugs.webkit.org/show_bug.cgi?id=129466
Summary
indexOf and lastIndexOf shouldn't resolve ropes when needle is longer than ha...
Ryosuke Niwa
Reported
2014-02-27 20:38:21 PST
Right now indexOf and lastIndexOf always resolves ropes via JSString::toString. Just return -1 before resolving ropes when needle is longer than haystack.
Attachments
Patch
(4.12 KB, patch)
2014-02-27 20:40 PST
,
Ryosuke Niwa
msaboff
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2014-02-27 20:39:04 PST
<
rdar://problem/16192706
>
Radar WebKit Bug Importer
Comment 2
2014-02-27 20:39:07 PST
<
rdar://problem/16192707
>
Ryosuke Niwa
Comment 3
2014-02-27 20:40:34 PST
Created
attachment 225434
[details]
Patch
Michael Saboff
Comment 4
2014-02-27 21:13:50 PST
Comment on
attachment 225434
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=225434&action=review
r=me
> Source/JavaScriptCore/ChangeLog:8 > + Refactored the code to avoid calling toString on JSString when needle is longer than haystack.
It is actually JSString::value that you are avoiding.
Ryosuke Niwa
Comment 5
2014-02-27 21:20:28 PST
Thanks for the review. (In reply to
comment #4
)
> (From update of
attachment 225434
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=225434&action=review
> > r=me > > > Source/JavaScriptCore/ChangeLog:8 > > + Refactored the code to avoid calling toString on JSString when needle is longer than haystack. > > It is actually JSString::value that you are avoiding.
Oops, yes. Will fix before landing it.
Ryosuke Niwa
Comment 6
2014-02-27 21:24:33 PST
Committed
r164851
: <
http://trac.webkit.org/changeset/164851
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug