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

Unified Diff: src/wasm/encoder.cc

Issue 2013393002: Fix wrong endianness of wasm header in WasmModuleWriter on big-endian platforms (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | « src/base/bits.h ('k') | src/wasm/wasm-external-refs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/encoder.cc
diff --git a/src/wasm/encoder.cc b/src/wasm/encoder.cc
index c563e22411033400e641dd4a882d9f0882d1e017..3a2015037e676f8056ba00f5ce47ba31f44f8d01 100644
--- a/src/wasm/encoder.cc
+++ b/src/wasm/encoder.cc
@@ -11,6 +11,7 @@
#include "src/wasm/ast-decoder.h"
#include "src/wasm/encoder.h"
#include "src/wasm/leb-helper.h"
+#include "src/wasm/wasm-external-refs.h"
#include "src/wasm/wasm-macro-gen.h"
#include "src/wasm/wasm-module.h"
#include "src/wasm/wasm-opcodes.h"
@@ -298,8 +299,8 @@ void WasmModuleWriter::WriteTo(ZoneBuffer& buffer) const {
// == Emit magic =============================================================
TRACE("emit magic\n");
- buffer.write_u32(kWasmMagic);
- buffer.write_u32(kWasmVersion);
+ buffer.write_u32(word32_to_little_endianness(&kWasmMagic));
titzer 2016/05/27 10:47:27 What about instead making the write_u32 function a
ivica.bogosavljevic 2016/05/27 12:23:24 Say no more!
+ buffer.write_u32(word32_to_little_endianness(&kWasmVersion));
// == Emit signatures ========================================================
if (signatures_.size() > 0) {
« no previous file with comments | « src/base/bits.h ('k') | src/wasm/wasm-external-refs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698