<?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>57822</bug_id>
          
          <creation_ts>2011-04-05 02:08:13 -0700</creation_ts>
          <short_desc>Build fix for YarrParser.h</short_desc>
          <delta_ts>2011-04-05 15:04:59 -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>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Balazs Kelemen">kbalazs</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abecsi</cc>
    
    <cc>barraclough</cc>
    
    <cc>christoph</cc>
    
    <cc>msaboff</cc>
    
    <cc>ossy</cc>
    
    <cc>pvarga</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>379383</commentid>
    <comment_count>0</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2011-04-05 02:08:13 -0700</bug_when>
    <thetext>It does not compile for a long time in my local environment which is: gcc (SUSE Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292].</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379384</commentid>
    <comment_count>1</comment_count>
      <attachid>88191</attachid>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2011-04-05 02:10:52 -0700</bug_when>
    <thetext>Created attachment 88191
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379395</commentid>
    <comment_count>2</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2011-04-05 02:21:16 -0700</bug_when>
    <thetext>I&apos;m not sure which initialization value should we 
use, ask the Yarr experts, Cpt Stampho and/or Gavin.

*** This bug has been marked as a duplicate of bug 55576 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379407</commentid>
    <comment_count>3</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2011-04-05 02:44:27 -0700</bug_when>
    <thetext>The other bug has not patch and I won&apos;t re-upload mine.
0 is seems like a natural value for UChar. Here is some grep output:
Source/JavaScriptCore/runtime/StringPrototype.cpp:865:    UChar ored = 0;
Source/JavaScriptCore/runtime/StringPrototype.cpp:905:    UChar ored = 0;
Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:81:    UChar u = 0;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379414</commentid>
    <comment_count>4</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2011-04-05 03:12:06 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; The other bug has not patch and I won&apos;t re-upload mine.
Nobody asked you to upload your patch again ...

&gt; 0 is seems like a natural value for UChar. Here is some grep output:
&gt; Source/JavaScriptCore/runtime/StringPrototype.cpp:865:    UChar ored = 0;
&gt; Source/JavaScriptCore/runtime/StringPrototype.cpp:905:    UChar ored = 0;
&gt; Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:81:    UChar u = 0;

It is absolutely useless information. We can&apos;t fix the bug without understanding the Yarr parser. I don&apos;t know if m_character is used
somewhere before initializing. But using a possibly wrong init value
is so wrong as using an uninitialized value.

Gavin, could you check if this initialization is correct or not?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379416</commentid>
    <comment_count>5</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2011-04-05 03:13:37 -0700</bug_when>
    <thetext>*** Bug 55576 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379442</commentid>
    <comment_count>6</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2011-04-05 04:28:53 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; The other bug has not patch and I won&apos;t re-upload mine.
&gt; Nobody asked you to upload your patch again ...
&gt; 
&gt; &gt; 0 is seems like a natural value for UChar. Here is some grep output:
&gt; &gt; Source/JavaScriptCore/runtime/StringPrototype.cpp:865:    UChar ored = 0;
&gt; &gt; Source/JavaScriptCore/runtime/StringPrototype.cpp:905:    UChar ored = 0;
&gt; &gt; Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:81:    UChar u = 0;
&gt; 
&gt; It is absolutely useless information. We can&apos;t fix the bug without understanding the Yarr parser. I don&apos;t know if m_character is used
&gt; somewhere before initializing.

Don&apos;t you think that 0 is better than memory garbage? What else can be the initialization value for an integral type? I don&apos;t understand your concerns.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379653</commentid>
    <comment_count>7</comment_count>
      <attachid>88191</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-04-05 09:40:15 -0700</bug_when>
    <thetext>Comment on attachment 88191
Patch

I think that we don’t want to initialize things just on general principles or because “initialized is better than uninitialized”. It’s best to set the initial value based on an understanding of how the value will be used.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379658</commentid>
    <comment_count>8</comment_count>
      <attachid>88191</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-04-05 09:43:01 -0700</bug_when>
    <thetext>Comment on attachment 88191
Patch

If we do make this change, it will be just to make the compiler happy. When m_state is Empty it is illegal to look at the character value, so initializing it is only helpful to mitigate programming mistakes. If m_state is set to another state where m_character is used, then m_character will be set appropriately.

The compiler can’t analyze the data flow well enough to see the relationship so it thinks there is a potential problem here, but there is none.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379880</commentid>
    <comment_count>9</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2011-04-05 14:59:54 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; (From update of attachment 88191 [details])
&gt; If we do make this change, it will be just to make the compiler happy. When m_state is Empty it is illegal to look at the character value, so initializing it is only helpful to mitigate programming mistakes. If m_state is set to another state where m_character is used, then m_character will be set appropriately.
&gt; 
&gt; The compiler can’t analyze the data flow well enough to see the relationship so it thinks there is a potential problem here, but there is none.

Sure. The only motivation behind this patch is to make the compiler happy.
Thanks for the review!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379888</commentid>
    <comment_count>10</comment_count>
      <attachid>88191</attachid>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2011-04-05 15:04:52 -0700</bug_when>
    <thetext>Comment on attachment 88191
Patch

Clearing flags on attachment: 88191

Committed r82988: &lt;http://trac.webkit.org/changeset/82988&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379889</commentid>
    <comment_count>11</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2011-04-05 15:04:59 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>88191</attachid>
            <date>2011-04-05 02:10:52 -0700</date>
            <delta_ts>2011-04-05 15:04:52 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-57822-20110405111050.patch</filename>
            <type>text/plain</type>
            <size>1141</size>
            <attacher name="Balazs Kelemen">kbalazs</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogODI3NzEKZGlmZiAtLWdpdCBhL1NvdXJjZS9KYXZhU2NyaXB0
Q29yZS9DaGFuZ2VMb2cgYi9Tb3VyY2UvSmF2YVNjcmlwdENvcmUvQ2hhbmd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JpcHRDb3JlL3lhcnIvWWFy
clBhcnNlci5oCisrKyBiL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS95YXJyL1lhcnJQYXJzZXIuaApA
QCAtNzgsNiArNzgsNyBAQCBwcml2YXRlOgogICAgICAgICAgICAgOiBtX2RlbGVnYXRlKGRlbGVn
YXRlKQogICAgICAgICAgICAgLCBtX2VycihlcnIpCiAgICAgICAgICAgICAsIG1fc3RhdGUoRW1w
dHkpCisgICAgICAgICAgICAsIG1fY2hhcmFjdGVyKDApCiAgICAgICAgIHsKICAgICAgICAgfQog
Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>