Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h

Issue 2321713002: Add a static_cast to fix a bug in ScriptValueSerializer::doReadUint64. (Closed)
Patch Set: align the buffer, because there is an assertion that demands it Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h
index a6f60a45095f68d054051501e960cd1aa84bc575..d624878d08ee90b20649587ab986a6060cfec7be 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h
@@ -5,6 +5,7 @@
#ifndef ScriptValueSerializer_h
#define ScriptValueSerializer_h
+#include "base/gtest_prod_util.h"
#include "bindings/core/v8/SerializationTag.h"
#include "bindings/core/v8/SerializedScriptValue.h"
#include "bindings/core/v8/V8Binding.h"
@@ -540,7 +541,7 @@ private:
if (m_position >= m_length)
return false;
currentByte = m_buffer[m_position++];
- *value |= ((currentByte & SerializedScriptValue::varIntMask) << shift);
+ *value |= (static_cast<T>(currentByte & SerializedScriptValue::varIntMask) << shift);
shift += SerializedScriptValue::varIntShift;
} while (currentByte & (1 << SerializedScriptValue::varIntShift));
return true;
@@ -557,6 +558,8 @@ private:
uint32_t m_version;
const WebBlobInfoArray* m_blobInfo;
const BlobDataHandleMap& m_blobDataHandles;
+
+ FRIEND_TEST_ALL_PREFIXES(ScriptValueSerializerTest, Uint64Decode);
};
class CORE_EXPORT ScriptValueDeserializer {
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698