Bug 232024

Summary: Add missing overflow checks to DFGIntegerRangeOptimizationPhase::isEquivalentTo()
Product: WebKit Reporter: Michael Saboff <msaboff>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, mark.lam, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch with mini-mode fix. tzagallo: review+

Description Michael Saboff 2021-10-20 11:11:03 PDT
In isEquivalentTo() we should check for overflow when adding offsets.

    bool isEquivalentTo(const Relationship& other) const
    {
        ...

        if (m_right->isInt32Constant() && other.m_right->isInt32Constant()) {
            return (thisRight + m_offset) == (otherRight + other.m_offset);
        }
        ...
    }
Comment 1 Michael Saboff 2021-10-20 11:20:12 PDT
Created attachment 441903 [details]
Patch with mini-mode fix.
Comment 2 Tadeu Zagallo 2021-10-20 11:21:37 PDT
Comment on attachment 441903 [details]
Patch with mini-mode fix.

r=me
Comment 3 Michael Saboff 2021-10-20 11:23:31 PDT
<rdar://84329018>
Comment 4 Michael Saboff 2021-10-20 11:24:28 PDT
Ignore the "mini-mode" comment - It was auto filled from Safari.
Comment 5 Mark Lam 2021-10-20 11:30:04 PDT
Comment on attachment 441903 [details]
Patch with mini-mode fix.

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

> Source/JavaScriptCore/ChangeLog:8
> +        Added overflow chaeck before comparing for equality.

typo: chaeck
Comment 6 Michael Saboff 2021-10-20 11:30:47 PDT
(In reply to Mark Lam from comment #5)
> Comment on attachment 441903 [details]
> Patch with mini-mode fix.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=441903&action=review
> 
> > Source/JavaScriptCore/ChangeLog:8
> > +        Added overflow chaeck before comparing for equality.
> 
> typo: chaeck

Will fix.
Comment 7 Michael Saboff 2021-10-20 14:45:18 PDT
Committed r284573 (243313@main): <https://commits.webkit.org/243313@main>