Bug 205947 - TypeProfiler.h: Multiplication result converted to larger type
Summary: TypeProfiler.h: Multiplication result converted to larger type
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-08 11:52 PST by Michael Saboff
Modified: 2020-01-08 14:04 PST (History)
7 users (show)

See Also:


Attachments
Patch (1.20 KB, patch)
2020-01-08 13:25 PST, Michael Saboff
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2020-01-08 11:52:39 PST
Summary:
TypeProfiler.h: Multiplication result converted to larger type: Multiplication result may overflow 'unsigned int' before it is converted to 'unsigned long'.

    unsigned hash() const 
    { 
        unsigned hash = m_sourceID + m_divot * m_searchDescriptor;
Multiplication result may overflow 'unsigned int' before it is converted to 'long'.
        return hash;
    }

fix: fix cast m_sourceID to unsigned or cast the whole result to unsigned.
Comment 1 Michael Saboff 2020-01-08 11:52:47 PST
<rdar://problem/58383288>
Comment 2 Michael Saboff 2020-01-08 13:25:23 PST
Created attachment 387131 [details]
Patch
Comment 3 WebKit Commit Bot 2020-01-08 14:04:16 PST
Comment on attachment 387131 [details]
Patch

Clearing flags on attachment: 387131

Committed r254224: <https://trac.webkit.org/changeset/254224>
Comment 4 WebKit Commit Bot 2020-01-08 14:04:17 PST
All reviewed patches have been landed.  Closing bug.