Bug 132772 - [Win] Enum type with value zero is compatible with void*, potential cause of crashes.
Summary: [Win] Enum type with value zero is compatible with void*, potential cause of ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 132839
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-10 02:30 PDT by peavo
Modified: 2014-05-13 13:57 PDT (History)
6 users (show)

See Also:


Attachments
Patch (19.46 KB, patch)
2014-05-10 02:39 PDT, peavo
no flags Details | Formatted Diff | Diff
Patch (20.76 KB, patch)
2014-05-13 12:48 PDT, peavo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description peavo 2014-05-10 02:30:08 PDT
Using the MSVC compiler, an instance of an enum type with value zero, is compatible with void* (see bug 132683 for a code example).
This has caused crashes on Windows on two occasions (bug 132683, and bug 121001).
This patch tries to prevent these type of crashes by using a type with explicit constructors instead of void*.
Comment 1 peavo 2014-05-10 02:39:21 PDT
Created attachment 231223 [details]
Patch
Comment 2 Geoffrey Garen 2014-05-10 12:58:01 PDT
Comment on attachment 231223 [details]
Patch

r=me
Comment 3 peavo 2014-05-10 13:06:53 PDT
(In reply to comment #2)
> (From update of attachment 231223 [details])
> r=me

Thanks!
Comment 4 peavo 2014-05-12 11:56:38 PDT
cq+? ;)
Comment 5 WebKit Commit Bot 2014-05-12 13:42:53 PDT
Comment on attachment 231223 [details]
Patch

Clearing flags on attachment: 231223

Committed r168642: <http://trac.webkit.org/changeset/168642>
Comment 6 WebKit Commit Bot 2014-05-12 13:42:57 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 WebKit Commit Bot 2014-05-12 15:12:22 PDT
Re-opened since this is blocked by bug 132839
Comment 8 peavo 2014-05-13 12:48:41 PDT
Created attachment 231401 [details]
Patch
Comment 9 peavo 2014-05-13 12:50:59 PDT
(In reply to comment #8)
> Created an attachment (id=231401) [details]
> Patch

Sorry for the inconvenience. Updated patch.
Comment 10 Geoffrey Garen 2014-05-13 12:59:20 PDT
Comment on attachment 231401 [details]
Patch

Let's give this another go.
Comment 11 peavo 2014-05-13 13:24:49 PDT
(In reply to comment #10)
> (From update of attachment 231401 [details])
> Let's give this another go.

Thanks :)
Comment 12 WebKit Commit Bot 2014-05-13 13:57:39 PDT
Comment on attachment 231401 [details]
Patch

Clearing flags on attachment: 231401

Committed r168729: <http://trac.webkit.org/changeset/168729>
Comment 13 WebKit Commit Bot 2014-05-13 13:57:43 PDT
All reviewed patches have been landed.  Closing bug.