Bug 132772

Summary: [Win] Enum type with value zero is compatible with void*, potential cause of crashes.
Product: WebKit Reporter: peavo
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, ggaren, jeffrey+webkit, mark.lam, msaboff
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 132839    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch none

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.