<?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>54687</bug_id>
          
          <creation_ts>2011-02-17 14:00:38 -0800</creation_ts>
          <short_desc>Invalid label can be added into backtrack when building with armcc</short_desc>
          <delta_ts>2011-02-22 08:28:20 -0800</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>Other</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Blocker</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yong Li">yong.li.webkit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>barraclough</cc>
    
    <cc>commit-queue</cc>
    
    <cc>eric</cc>
    
    <cc>msaboff</cc>
    
    <cc>staikos</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>353158</commentid>
    <comment_count>0</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2011-02-17 14:00:38 -0800</bug_when>
    <thetext>Yarr::GenerationState::BacktrackDestination::hasDataLabel() doesn&apos;t work when it is built with armcc, because JmpDst::isSet compares m_offset against -1, and m_offset is declared with &quot;int m_offset : 31&quot;. According to standards, it depends on the compiler implementation that &quot;int&quot; bit field is signed or unsigned. After changing it to &quot;signed int m_offset : 31&quot;, it works well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>353160</commentid>
    <comment_count>1</comment_count>
      <attachid>82858</attachid>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2011-02-17 14:04:10 -0800</bug_when>
    <thetext>Created attachment 82858
the fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>353171</commentid>
    <comment_count>2</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2011-02-17 14:17:24 -0800</bug_when>
    <thetext>There are other cases where we use &quot;int&quot; to declare signed bit field. We should also change them to &quot;signed int&quot;. That should be low priority and I prefer to do that in another bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>353382</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-02-17 20:50:02 -0800</bug_when>
    <thetext>Is this covered by existing regression tests?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>353554</commentid>
    <comment_count>4</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2011-02-18 06:05:11 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; Is this covered by existing regression tests?

I&apos;ll give a try. It is hard for me to write a test case for this because I know very little about how YarrJIT works. The change is harmless. I also plan to make such change to other places including those in WebCore even they haven&apos;t caused any known problem. Probably we should have this rule in coding guidelines: &quot;Always explicitly use &quot;signed&quot;/&quot;unsigned&quot; to declare integral bit fields&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>353722</commentid>
    <comment_count>5</comment_count>
      <attachid>82858</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-02-18 11:56:04 -0800</bug_when>
    <thetext>Comment on attachment 82858
the fix

We&apos;ve had related trouble with bitfields using MSVC as well.  There the problem was that enum is a &quot;signed int&quot; and when you make it a bitfield it uses one of the bits as a sign when you don&apos;t expect it to. :)

This change seems fine.  Seems you might want a comment here to explain why you need the &quot;signed&quot; part.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>354156</commentid>
    <comment_count>6</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2011-02-19 07:43:00 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; (From update of attachment 82858 [details])
&gt; We&apos;ve had related trouble with bitfields using MSVC as well.  There the problem was that enum is a &quot;signed int&quot; and when you make it a bitfield it uses one of the bits as a sign when you don&apos;t expect it to. :)
&gt; 
&gt; This change seems fine.  Seems you might want a comment here to explain why you need the &quot;signed&quot; part.

Thanks. I plan to add &quot;sign&quot; to all similar places to make the code independent from the implementation differences of compilers (seems Qt always uses &quot;signed&quot; to declare signed bitfields). After that is done, the change in ARMAssember.h will not be special.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>354166</commentid>
    <comment_count>7</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2011-02-19 07:58:26 -0800</bug_when>
    <thetext>Bug 54807 created for the rest places we use &quot;int&quot;/&quot;short&quot; to declare bitfields</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>354167</commentid>
    <comment_count>8</comment_count>
      <attachid>82858</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-19 08:06:40 -0800</bug_when>
    <thetext>Comment on attachment 82858
the fix

Clearing flags on attachment: 82858

Committed r79124: &lt;http://trac.webkit.org/changeset/79124&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>354168</commentid>
    <comment_count>9</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-19 08:06:45 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>354238</commentid>
    <comment_count>10</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-02-19 20:53:01 -0800</bug_when>
    <thetext>This patch makes no sense to me. &quot;int&quot; is always signed in C++.

Eric, I don&apos;t understand why this has been given green light. There is no explanation of what specific problem this patch fixes, and according to comment 4, even regression tests haven&apos;t been run!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>354241</commentid>
    <comment_count>11</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-02-19 21:52:53 -0800</bug_when>
    <thetext>(In reply to comment #10)
&gt; This patch makes no sense to me. &quot;int&quot; is always signed in C++.
&gt; 
&gt; Eric, I don&apos;t understand why this has been given green light. There is no explanation of what specific problem this patch fixes, and according to comment 4, even regression tests haven&apos;t been run!

The patch seemed reasonable to me.  Yes, ideally there should have been a link to the armcc bug (as I requested in the other bug he filed on this subject).

He states in comment 0 that according to his (I assume yong is a he?) reading of the c++ spec ints in bitfields are unspecified as to their sign.  I&apos;ve not confirmed this.  But I could believe that armcc might have such a bug.

The cq obviously ran the regression tests. :)

Feel free to roll out the change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>354244</commentid>
    <comment_count>12</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-02-19 22:34:00 -0800</bug_when>
    <thetext>&gt; The cq obviously ran the regression tests. :)

I meant, the tests haven&apos;t been run on the affected platform.

Since this isn&apos;t breaking anything, there is no rush to roll out, and I&apos;ll give some time for everyone to comment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>354252</commentid>
    <comment_count>13</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-02-19 23:13:37 -0800</bug_when>
    <thetext>Daniel Bates explained in bug 54807 that I was wrong - bitfields are an exception where &quot;signed int&quot; is different from &quot;int&quot;.

I think that this should have used &quot;signed&quot;, not &quot;signed int&quot; though, just like we never write &quot;unsigned int&quot; in WebKit code. And it doesn&apos;t look like we had a good explanation of why there is no regression test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>355289</commentid>
    <comment_count>14</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2011-02-22 08:28:20 -0800</bug_when>
    <thetext>(In reply to comment #13)
&gt; Daniel Bates explained in bug 54807 that I was wrong - bitfields are an exception where &quot;signed int&quot; is different from &quot;int&quot;.
&gt; 
&gt; I think that this should have used &quot;signed&quot;, not &quot;signed int&quot; though, just like we never write &quot;unsigned int&quot; in WebKit code. And it doesn&apos;t look like we had a good explanation of why there is no regression test.

I just tried a few existing JS tests, and I haven&apos;t been able to find one that doesn&apos;t crash without the fix. (For example, fast/js/const.html, fast/js/array-foreach.html, ...)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>82858</attachid>
            <date>2011-02-17 14:04:10 -0800</date>
            <delta_ts>2011-02-19 08:06:40 -0800</delta_ts>
            <desc>the fix</desc>
            <filename>54687.patch</filename>
            <type>text/plain</type>
            <size>1585</size>
            <attacher name="Yong Li">yong.li.webkit</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cgYi9Tb3VyY2UvSmF2
YVNjcmlwdENvcmUvQ2hhbmdlTG9nCmluZGV4IDM0MjVjYWIuLjMzOWY0ZTQgMTAwNjQ0Ci0tLSBh
L1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL0phdmFTY3JpcHRD
b3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE1IEBACisyMDExLTAyLTE3ICBZb25nIExpICA8eW9s
aUByaW0uY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAg
ICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD01NDY4NworICAgICAg
ICBXaGVuIGJlaW5nIGJ1aWx0IHdpdGggYXJtY2MsICJpbnQiIGJpdCBmaWVsZHMgYXJlIHRyZWF0
ZWQgYXMKKyAgICAgICAgdW5zaWduZWQgaW50ZWdlcnMsIHdoaWNoIHdpbGwgZmFpbCB0aGUgY29t
cGFyaXNvbnMgbGlrZSAibV9vZmZzZXQgPT0g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1IDEwMDY0NAotLS0gYS9Tb3VyY2UvSmF2
YVNjcmlwdENvcmUvYXNzZW1ibGVyL0FSTXY3QXNzZW1ibGVyLmgKKysrIGIvU291cmNlL0phdmFT
Y3JpcHRDb3JlL2Fzc2VtYmxlci9BUk12N0Fzc2VtYmxlci5oCkBAIC01MjgsNyArNTI4LDcgQEAg
cHVibGljOgogICAgICAgICAgICAgQVNTRVJUKG1fb2Zmc2V0ID09IG9mZnNldCk7CiAgICAgICAg
IH0KIAotICAgICAgICBpbnQgbV9vZmZzZXQgOiAzMTsKKyAgICAgICAgc2lnbmVkIGludCBtX29m
ZnNldCA6IDMxOwogICAgICAgICBpbnQgbV91c2VkIDogMTsKICAgICB9OwogCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>