<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>137471</bug_id>
          
          <creation_ts>2014-10-06 17:22:31 -0700</creation_ts>
          <short_desc>[Win] Use of 1-bit Enum type behaves improperly</short_desc>
          <delta_ts>2014-10-06 20:11:38 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brent Fulgham">bfulgham</reporter>
          <assigned_to name="Brent Fulgham">bfulgham</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>mark.lam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1039886</commentid>
    <comment_count>0</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-10-06 17:22:31 -0700</bug_when>
    <thetext>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&apos;t run into this on Windows builds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1039887</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2014-10-06 17:23:12 -0700</bug_when>
    <thetext>&lt;rdar://problem/18563519&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1039888</commentid>
    <comment_count>2</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-10-06 17:23:25 -0700</bug_when>
    <thetext>See also Bug 134252.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1039891</commentid>
    <comment_count>3</comment_count>
      <attachid>239369</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-10-06 17:27:24 -0700</bug_when>
    <thetext>Created attachment 239369
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1039910</commentid>
    <comment_count>4</comment_count>
      <attachid>239369</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2014-10-06 18:18:24 -0700</bug_when>
    <thetext>Comment on attachment 239369
Patch

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

r=me with the comment added.

&gt; Source/JavaScriptCore/debugger/Debugger.h:195
&gt; +    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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1039925</commentid>
    <comment_count>5</comment_count>
      <attachid>239369</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-10-06 20:10:37 -0700</bug_when>
    <thetext>Comment on attachment 239369
Patch

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

&gt;&gt; Source/JavaScriptCore/debugger/Debugger.h:195
&gt;&gt; +    unsigned m_steppingMode : 1;
&gt; 
&gt; I recall Darin saying that the accepted practice is to add a trailing comment to indicate the expected type:
&gt; 
&gt; unsigned m_steppingMode : 1; // SteppingMode

Will do!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1039926</commentid>
    <comment_count>6</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-10-06 20:11:38 -0700</bug_when>
    <thetext>Committed in r174381. &lt;http://trac.webkit.org/changeset/174381&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>239369</attachid>
            <date>2014-10-06 17:27:24 -0700</date>
            <delta_ts>2014-10-06 20:10:37 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-137471-20141006172726.patch</filename>
            <type>text/plain</type>
            <size>1690</size>
            <attacher name="Brent Fulgham">bfulgham</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTc0Mzc0KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE2IEBA
CisyMDE0LTEwLTA2ICBCcmVudCBGdWxnaGFtICA8YmZ1bGdoYW1AYXBwbGUuY29tPgorCisgICAg
ICAgIFtXaW5dIFVzZSBvZiAxLWJpdCBFbnVtIHR5cGUgYmVoYXZlcyBpbXByb3Blcmx5CisgICAg
ICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xMzc0NzEKKyAgICAg
ICAgPHJkYXI6Ly9wcm9ibGVtLzE4NTU5MTcyPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9E
WSAoT09QUyEpLgorCisgICAgICAgIFJlcHJlc2VudCAxLWJpdCBlbnVtIGVsZW1lbnQgYXMgJ3Vu
c2lnbmVkJywgYXMgd2UgaGF2ZSBkb25lIGVsc2V3aGVyZQorICAgICAgICBpbiBXZWJLaXQgdG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mIGVycm9yTWVzc2FnZSkgPSAwOwogCkBAIC0xOTIsNyArMTkyLDcgQEAgcHJpdmF0ZToK
ICAgICBib29sIG1fYnJlYWtwb2ludHNBY3RpdmF0ZWQgOiAxOwogICAgIGJvb2wgbV9oYXNIYW5k
bGVyRm9yRXhjZXB0aW9uQ2FsbGJhY2sgOiAxOwogICAgIGJvb2wgbV9pc0luV29ya2VyVGhyZWFk
IDogMTsKLSAgICBTdGVwcGluZ01vZGUgbV9zdGVwcGluZ01vZGUgOiAxOworICAgIHVuc2lnbmVk
IG1fc3RlcHBpbmdNb2RlIDogMTsKIAogICAgIFJlYXNvbkZvclBhdXNlIG1fcmVhc29uRm9yUGF1
c2U7CiAgICAgSlNWYWx1ZSBtX2N1cnJlbnRFeGNlcHRpb247Cg==
</data>
<flag name="review"
          id="264093"
          type_id="1"
          status="+"
          setter="mark.lam"
    />
          </attachment>
      

    </bug>

</bugzilla>