WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
137471
[Win] Use of 1-bit Enum type behaves improperly
https://bugs.webkit.org/show_bug.cgi?id=137471
Summary
[Win] Use of 1-bit Enum type behaves improperly
Brent Fulgham
Reported
2014-10-06 17:22:31 PDT
MSVC implements enumerated types as signed values. This causes problems when enums are used as elements in a bit field (especially 1-bit elements) because MSVC wants to include a sign bit in its encoding. This means we lose one bit of resolution, often causing incorrect behavior. Static analysis found this problem in Debugger.h. This patch corrects the bug so that we don't run into this on Windows builds.
Attachments
Patch
(1.65 KB, patch)
2014-10-06 17:27 PDT
,
Brent Fulgham
mark.lam
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2014-10-06 17:23:12 PDT
<
rdar://problem/18563519
>
Brent Fulgham
Comment 2
2014-10-06 17:23:25 PDT
See also
Bug 134252
.
Brent Fulgham
Comment 3
2014-10-06 17:27:24 PDT
Created
attachment 239369
[details]
Patch
Mark Lam
Comment 4
2014-10-06 18:18:24 PDT
Comment on
attachment 239369
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=239369&action=review
r=me with the comment added.
> Source/JavaScriptCore/debugger/Debugger.h:195 > + unsigned m_steppingMode : 1;
I recall Darin saying that the accepted practice is to add a trailing comment to indicate the expected type: unsigned m_steppingMode : 1; // SteppingMode
Brent Fulgham
Comment 5
2014-10-06 20:10:37 PDT
Comment on
attachment 239369
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=239369&action=review
>> Source/JavaScriptCore/debugger/Debugger.h:195 >> + unsigned m_steppingMode : 1; > > I recall Darin saying that the accepted practice is to add a trailing comment to indicate the expected type: > > unsigned m_steppingMode : 1; // SteppingMode
Will do!
Brent Fulgham
Comment 6
2014-10-06 20:11:38 PDT
Committed in
r174381
. <
http://trac.webkit.org/changeset/174381
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug