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

Unified Diff: src/assembler.h

Issue 2416543002: [wasm] Fix bounds check for zero initial memory. (Closed)
Patch Set: Created 4 years, 2 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 | src/assembler.cc » ('j') | src/assembler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.h
diff --git a/src/assembler.h b/src/assembler.h
index a925032e2d72bb86995ea1d798f687c403f50019..c824bd5534fbb7861e3e5680d70ca81d5a528786 100644
--- a/src/assembler.h
+++ b/src/assembler.h
@@ -392,7 +392,10 @@ class RelocInfo {
// To relocate pointers into the wasm memory embedded in wasm code
WASM_MEMORY_REFERENCE,
WASM_GLOBAL_REFERENCE,
- WASM_MEMORY_SIZE_REFERENCE,
+ WASM_MEMORY_BYTE_SIZE_REFERENCE,
+ WASM_MEMORY_WORD_SIZE_REFERENCE,
+ WASM_MEMORY_DWORD_SIZE_REFERENCE,
+ WASM_MEMORY_QWORD_SIZE_REFERENCE,
CELL,
// Everything after runtime_entry (inclusive) is not GC'ed.
@@ -437,7 +440,7 @@ class RelocInfo {
FIRST_REAL_RELOC_MODE = CODE_TARGET,
LAST_REAL_RELOC_MODE = VENEER_POOL,
LAST_CODE_ENUM = DEBUGGER_STATEMENT,
- LAST_GCED_ENUM = WASM_MEMORY_SIZE_REFERENCE,
+ LAST_GCED_ENUM = WASM_MEMORY_QWORD_SIZE_REFERENCE,
FIRST_SHAREABLE_RELOC_MODE = CELL,
};
@@ -528,7 +531,10 @@ class RelocInfo {
return mode == WASM_MEMORY_REFERENCE;
}
static inline bool IsWasmMemorySizeReference(Mode mode) {
- return mode == WASM_MEMORY_SIZE_REFERENCE;
+ return mode == WASM_MEMORY_BYTE_SIZE_REFERENCE ||
+ mode == WASM_MEMORY_WORD_SIZE_REFERENCE ||
+ mode == WASM_MEMORY_DWORD_SIZE_REFERENCE ||
+ mode == WASM_MEMORY_QWORD_SIZE_REFERENCE;
}
static inline bool IsWasmGlobalReference(Mode mode) {
return mode == WASM_GLOBAL_REFERENCE;
« no previous file with comments | « no previous file | src/assembler.cc » ('j') | src/assembler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698