Bug 198271 - JITOperations putByVal should mark negative array indices as out-of-bounds
Summary: JITOperations putByVal should mark negative array indices as out-of-bounds
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tadeu Zagallo
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-05-27 04:45 PDT by Tadeu Zagallo
Modified: 2019-05-28 09:04 PDT (History)
10 users (show)

See Also:


Attachments
Patch (5.33 KB, patch)
2019-05-27 05:05 PDT, Tadeu Zagallo
no flags Details | Formatted Diff | Diff
Patch for landing (4.27 KB, patch)
2019-05-28 08:47 PDT, Tadeu Zagallo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tadeu Zagallo 2019-05-27 04:45:20 PDT
Like https://bugs.webkit.org/show_bug.cgi?id=198229, but for putByVal.
Comment 1 Tadeu Zagallo 2019-05-27 05:05:26 PDT
Created attachment 370689 [details]
Patch
Comment 2 Saam Barati 2019-05-27 11:22:19 PDT
Comment on attachment 370689 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=370689&action=review

> Source/JavaScriptCore/jit/JITOperations.cpp:665
> +putProperty:

Alternatively, you could have an “else if (subscript.isInt32() && baseValue.isObject()))” then mark as out of bounds
Comment 3 Tadeu Zagallo 2019-05-27 13:02:30 PDT
Comment on attachment 370689 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=370689&action=review

>> Source/JavaScriptCore/jit/JITOperations.cpp:665
>> +putProperty:
> 
> Alternatively, you could have an “else if (subscript.isInt32() && baseValue.isObject()))” then mark as out of bounds

What about `tookSlowPath`, do I also need to set it if it's int32 but not an object? I guess I don't get why don't we unconditionally set `tookSlowPath`.
Comment 4 Saam Barati 2019-05-27 23:48:10 PDT
Comment on attachment 370689 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=370689&action=review

>>> Source/JavaScriptCore/jit/JITOperations.cpp:665
>>> +putProperty:
>> 
>> Alternatively, you could have an “else if (subscript.isInt32() && baseValue.isObject()))” then mark as out of bounds
> 
> What about `tookSlowPath`, do I also need to set it if it's int32 but not an object? I guess I don't get why don't we unconditionally set `tookSlowPath`.

I'm also not sure. It probably has to do with normal indexed lookups, but you should look at the code in the DFG (I'm assuming) that reads it
Comment 5 Saam Barati 2019-05-27 23:48:25 PDT
Maybe it affects how we speculate.
Comment 6 Tadeu Zagallo 2019-05-28 08:47:49 PDT
Created attachment 370745 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2019-05-28 09:03:08 PDT
Comment on attachment 370745 [details]
Patch for landing

Clearing flags on attachment: 370745

Committed r245813: <https://trac.webkit.org/changeset/245813>
Comment 8 WebKit Commit Bot 2019-05-28 09:03:10 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2019-05-28 09:04:25 PDT
<rdar://problem/51180527>