<?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>114970</bug_id>
          
          <creation_ts>2013-04-22 11:25:27 -0700</creation_ts>
          <short_desc>StringImpl.h should compile with -Wshorten-64-to-32</short_desc>
          <delta_ts>2013-04-22 19:41: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>Web Template Framework</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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>107093</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="David Kilzer (:ddkilzer)">ddkilzer</assigned_to>
          <cc>benjamin</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>commit-queue</cc>
    
    <cc>darin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>879274</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2013-04-22 11:25:27 -0700</bug_when>
    <thetext>Fixes the following warnings with -Wshorten-64-to-32:

    StringImpl.h:317:25: error: implicit conversion loses integer precision: &apos;uintptr_t&apos; (aka &apos;unsigned long&apos;) to &apos;unsigned int&apos; [-Werror,-Wshorten-64-to-32]
            unsigned hash = reinterpret_cast&lt;uintptr_t&gt;(this);
                     ~~~~   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>879280</commentid>
    <comment_count>1</comment_count>
      <attachid>199053</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2013-04-22 11:27:24 -0700</bug_when>
    <thetext>Created attachment 199053
Patch v1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>879286</commentid>
    <comment_count>2</comment_count>
      <attachid>199053</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-04-22 11:33:28 -0700</bug_when>
    <thetext>Comment on attachment 199053
Patch v1

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

&gt; Source/WTF/wtf/text/StringImpl.h:316
&gt; -        unsigned hash = reinterpret_cast&lt;uintptr_t&gt;(this);
&gt; +        unsigned hash = static_cast&lt;uint32_t&gt;(reinterpret_cast&lt;uintptr_t&gt;(this));

This is a silly approach to creating the hash. For example, the low bits will always be due to alignment zero. I suggest we use a random number instead.

Code change is OK, but code is dumb.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>879371</commentid>
    <comment_count>3</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-04-22 12:11:27 -0700</bug_when>
    <thetext>The commit-queue encountered the following flaky tests while processing attachment 199053:

platform/mac/editing/deleting/deletionUI-single-instance.html bug 114181 (author: rniwa@webkit.org)
transitions/color-transition-rounding.html bug 114182 (author: simon.fraser@apple.com)
transitions/cubic-bezier-overflow-svg-length.html bug 114183 (author: peter@chromium.org)
transitions/interrupt-zero-duration.html bug 114184 (authors: cmarrin@apple.com, rniwa@webkit.org, and simon.fraser@apple.com)
transitions/multiple-background-transitions.html bug 114185 (author: simon.fraser@apple.com)
transitions/cubic-bezier-overflow-color.html bug 114186 (author: peter@chromium.org)
transitions/multiple-shadow-transitions.html bug 114187 (author: simon.fraser@apple.com)
transitions/mismatched-shadow-transitions.html bug 114188 (author: simon.fraser@apple.com)
transitions/color-transition-all.html bug 114189 (authors: ossy@webkit.org and simon.fraser@apple.com)
transitions/negative-delay.html bug 114190 (author: simon.fraser@apple.com)
transitions/cubic-bezier-overflow-shadow.html bug 114191 (author: peter@chromium.org)
transitions/min-max-width-height-transitions.html bug 114192 (author: simon.fraser@apple.com)
transitions/cancel-transition.html bug 114193 (authors: ojan@chromium.org, rniwa@webkit.org, and simon.fraser@apple.com)
transitions/border-radius-transition.html bug 114194 (author: simon.fraser@apple.com)
transitions/flex-transitions.html bug 114195 (author: tony@chromium.org)
transitions/mixed-type.html bug 114196 (author: mikelawther@chromium.org)
transitions/multiple-mask-transitions.html bug 114197 (author: simon.fraser@apple.com)
transitions/color-transition-premultiplied.html bug 114198 (author: simon.fraser@apple.com)
transitions/mismatched-shadow-styles.html bug 114199 (author: simon.fraser@apple.com)
transitions/mask-transitions.html bug 114200 (authors: ojan@chromium.org, oliver@apple.com, and simon.fraser@apple.com)
transitions/cubic-bezier-overflow-length.html bug 114201 (author: peter@chromium.org)
transitions/multiple-background-size-transitions.html bug 114202 (authors: mitz@webkit.org and simon.fraser@apple.com)
transitions/clip-transition.html bug 114203 (authors: dglazkov@chromium.org and simon.fraser@apple.com)
transitions/cubic-bezier-overflow-transform.html bug 114204 (author: peter@chromium.org)
transitions/shorthand-border-transitions.html bug 114205 (authors: ojan@chromium.org and simon.fraser@apple.com)
transitions/interrupted-accelerated-transition.html bug 56242 (authors: rniwa@webkit.org, simon.fraser@apple.com, and tonyg@chromium.org)
transitions/background-transitions.html bug 114206 (author: simon.fraser@apple.com)
http/tests/security/cookies/third-party-cookie-blocking-user-action.html bug 114511 (authors: ap@webkit.org, jochen@chromium.org, and rniwa@webkit.org)
http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame.html bug 114208 (authors: abarth@webkit.org and rniwa@webkit.org)
fast/loader/javascript-url-in-object.html bug 114210 (authors: rniwa@webkit.org and sam@webkit.org)
The commit-queue is continuing to process your patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>879372</commentid>
    <comment_count>4</comment_count>
      <attachid>199053</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-04-22 12:12:20 -0700</bug_when>
    <thetext>Comment on attachment 199053
Patch v1

Clearing flags on attachment: 199053

Committed r148900: &lt;http://trac.webkit.org/changeset/148900&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>879373</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-04-22 12:12:22 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>879381</commentid>
    <comment_count>6</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2013-04-22 12:20:04 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 199053 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=199053&amp;action=review
&gt; 
&gt; &gt; Source/WTF/wtf/text/StringImpl.h:316
&gt; &gt; -        unsigned hash = reinterpret_cast&lt;uintptr_t&gt;(this);
&gt; &gt; +        unsigned hash = static_cast&lt;uint32_t&gt;(reinterpret_cast&lt;uintptr_t&gt;(this));
&gt; 
&gt; This is a silly approach to creating the hash. For example, the low bits will always be due to alignment zero. I suggest we use a random number instead.
&gt; 
&gt; Code change is OK, but code is dumb.

Should we use WTF::intHash(uint32_t) on 32-bit platforms and WTF::intHas(uint64_t) on 64-bit platforms instead?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>879488</commentid>
    <comment_count>7</comment_count>
    <who name="Benjamin Poulain">benjamin</who>
    <bug_when>2013-04-22 15:48:53 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #2)
&gt; &gt; (From update of attachment 199053 [details] [details])
&gt; &gt; View in context: https://bugs.webkit.org/attachment.cgi?id=199053&amp;action=review
&gt; &gt; 
&gt; &gt; &gt; Source/WTF/wtf/text/StringImpl.h:316
&gt; &gt; &gt; -        unsigned hash = reinterpret_cast&lt;uintptr_t&gt;(this);
&gt; &gt; &gt; +        unsigned hash = static_cast&lt;uint32_t&gt;(reinterpret_cast&lt;uintptr_t&gt;(this));
&gt; &gt; 
&gt; &gt; This is a silly approach to creating the hash. For example, the low bits will always be due to alignment zero. I suggest we use a random number instead.
&gt; &gt; 
&gt; &gt; Code change is OK, but code is dumb.
&gt; 
&gt; Should we use WTF::intHash(uint32_t) on 32-bit platforms and WTF::intHas(uint64_t) on 64-bit platforms instead?

The only property needed for that hash is it should never equals the hash of emptyString().

We could basically use a constant here. Any number !m hash(empty()) has the same theoretical chances of conflicts.

I have been trying to kill this constructor every now and then :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>879520</commentid>
    <comment_count>8</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-04-22 16:34:51 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; The only property needed for that hash is it should never equals the hash of emptyString().

Maybe (hash(emptyString()) ^ 0x100) would work?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>879565</commentid>
    <comment_count>9</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2013-04-22 19:41:59 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; The only property needed for that hash is it should never equals the hash of emptyString().
&gt; 
&gt; Maybe (hash(emptyString()) ^ 0x100) would work?

Filed Bug 115008 to track this issue.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>199053</attachid>
            <date>2013-04-22 11:27:24 -0700</date>
            <delta_ts>2013-04-22 12:12:19 -0700</delta_ts>
            <desc>Patch v1</desc>
            <filename>bug-114970-20130422112649.patch</filename>
            <type>text/plain</type>
            <size>1910</size>
            <attacher name="David Kilzer (:ddkilzer)">ddkilzer</attacher>
            
              <data encoding="base64">U3VidmVyc2lvb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