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

Unified Diff: src/wasm/wasm-interpreter.cc

Issue 2285643002: [wasm] Validate the alignment of load and store instructions. (Closed)
Patch Set: Add alignment and maximum alignment information to the error message. 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 | « src/wasm/ast-decoder.cc ('k') | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-interpreter.cc
diff --git a/src/wasm/wasm-interpreter.cc b/src/wasm/wasm-interpreter.cc
index 7e3127dd533220342e6ffed20725768558bec5f1..17ca6111e3a5e947570491f32a4102a5d7383440 100644
--- a/src/wasm/wasm-interpreter.cc
+++ b/src/wasm/wasm-interpreter.cc
@@ -1444,7 +1444,7 @@ class ThreadImpl : public WasmInterpreter::Thread {
#define LOAD_CASE(name, ctype, mtype) \
case kExpr##name: { \
- MemoryAccessOperand operand(&decoder, code->at(pc)); \
+ MemoryAccessOperand operand(&decoder, code->at(pc), sizeof(ctype)); \
uint32_t index = Pop().to<uint32_t>(); \
size_t effective_mem_size = instance()->mem_size - sizeof(mtype); \
if (operand.offset > effective_mem_size || \
@@ -1476,7 +1476,7 @@ class ThreadImpl : public WasmInterpreter::Thread {
#define STORE_CASE(name, ctype, mtype) \
case kExpr##name: { \
- MemoryAccessOperand operand(&decoder, code->at(pc)); \
+ MemoryAccessOperand operand(&decoder, code->at(pc), sizeof(ctype)); \
WasmVal val = Pop(); \
uint32_t index = Pop().to<uint32_t>(); \
size_t effective_mem_size = instance()->mem_size - sizeof(mtype); \
« no previous file with comments | « src/wasm/ast-decoder.cc ('k') | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698