Fix type punning warning in HashTable.h debug builds
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Feb 2012 19:12:48 +0000 (19:12 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Feb 2012 19:12:48 +0000 (19:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77422

Patch by Andy Wingo <wingo@igalia.com> on 2012-02-02
Reviewed by Gavin Barraclough.

* wtf/HashTable.h (WTF::HashTable::checkKey): Fix type punning
warning appearing in debug builds with gcc-4.6.2 on GNU/Linux.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106574 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wtf/HashTable.h

index 1f53cd7..80afcb0 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-02  Andy Wingo  <wingo@igalia.com>
+
+        Fix type punning warning in HashTable.h debug builds
+        https://bugs.webkit.org/show_bug.cgi?id=77422
+
+        Reviewed by Gavin Barraclough.
+
+        * wtf/HashTable.h (WTF::HashTable::checkKey): Fix type punning
+        warning appearing in debug builds with gcc-4.6.2 on GNU/Linux.
+
 2012-02-01  Michael Saboff  <msaboff@apple.com>
 
         Yarr crash with regexp replace
index 44f9143..cbcc098 100644 (file)
@@ -478,7 +478,8 @@ namespace WTF {
             return;
         ASSERT(!HashTranslator::equal(KeyTraits::emptyValue(), key));
         AlignedBuffer<sizeof(ValueType), WTF_ALIGN_OF(ValueType)> deletedValueBuffer;
-        ValueType& deletedValue = *reinterpret_cast_ptr<ValueType*>(deletedValueBuffer.buffer);
+        ValueType* deletedValuePtr = reinterpret_cast_ptr<ValueType*>(deletedValueBuffer.buffer);
+        ValueType& deletedValue = *deletedValuePtr;
         Traits::constructDeletedValue(deletedValue);
         ASSERT(!HashTranslator::equal(Extractor::extract(deletedValue), key));
     }