Bug 188571 - [YARR] Align allocation size in BumpPointerAllocator with sizeof(void*)
Summary: [YARR] Align allocation size in BumpPointerAllocator with sizeof(void*)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-08-14 11:52 PDT by Yusuke Suzuki
Modified: 2018-08-16 02:42 PDT (History)
6 users (show)

See Also:


Attachments
Patch (5.99 KB, patch)
2018-08-14 11:55 PDT, Yusuke Suzuki
saam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2018-08-14 11:52:05 PDT
[YARR] Align allocation size in BumpPointerAllocator with sizeof(void*)
Comment 1 Yusuke Suzuki 2018-08-14 11:55:08 PDT
Created attachment 347100 [details]
Patch
Comment 2 Saam Barati 2018-08-15 14:33:22 PDT
Comment on attachment 347100 [details]
Patch

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

> Source/JavaScriptCore/yarr/YarrInterpreter.cpp:77
> +        static size_t allocationSize(size_t numberOfFrames)

Should we be worried about overflow here?

> Source/JavaScriptCore/yarr/YarrInterpreter.cpp:133
> +        static size_t allocationSize(size_t numberOfSubpatterns)

Ditto
Comment 3 Yusuke Suzuki 2018-08-16 02:36:19 PDT
Comment on attachment 347100 [details]
Patch

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

Thank you!

>> Source/JavaScriptCore/yarr/YarrInterpreter.cpp:77
>> +        static size_t allocationSize(size_t numberOfFrames)
> 
> Should we be worried about overflow here?

Use Checked<> here.

>> Source/JavaScriptCore/yarr/YarrInterpreter.cpp:133
>> +        static size_t allocationSize(size_t numberOfSubpatterns)
> 
> Ditto

Fixed by using Checked<>
Comment 4 Yusuke Suzuki 2018-08-16 02:41:42 PDT
Committed r234916: <https://trac.webkit.org/changeset/234916>
Comment 5 Radar WebKit Bug Importer 2018-08-16 02:42:22 PDT
<rdar://problem/43373238>