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

Unified Diff: src/wasm/wasm-module-builder.cc

Issue 2555243002: [wasm] Fix location for error in asm.js ToNumber conversion (Closed)
Patch Set: Fix gc error by storing callee_pc_address Created 4 years 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/wasm-module-builder.h ('k') | src/wasm/wasm-objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-module-builder.cc
diff --git a/src/wasm/wasm-module-builder.cc b/src/wasm/wasm-module-builder.cc
index 111b90ba372ea58766a930587088ab02eefad28c..bf9b4ef198f88300a25e5afd014b5a391aaa213e 100644
--- a/src/wasm/wasm-module-builder.cc
+++ b/src/wasm/wasm-module-builder.cc
@@ -150,7 +150,8 @@ void WasmFunctionBuilder::SetName(Vector<const char> name) {
memcpy(name_.data(), name.start(), name.length());
}
-void WasmFunctionBuilder::AddAsmWasmOffset(int asm_position) {
+void WasmFunctionBuilder::AddAsmWasmOffset(int call_position,
+ int to_number_position) {
// We only want to emit one mapping per byte offset:
DCHECK(asm_offsets_.size() == 0 || body_.size() > last_asm_byte_offset_);
@@ -159,9 +160,12 @@ void WasmFunctionBuilder::AddAsmWasmOffset(int asm_position) {
asm_offsets_.write_u32v(byte_offset - last_asm_byte_offset_);
last_asm_byte_offset_ = byte_offset;
- DCHECK_GE(asm_position, 0);
- asm_offsets_.write_i32v(asm_position - last_asm_source_position_);
- last_asm_source_position_ = asm_position;
+ DCHECK_GE(call_position, 0);
+ asm_offsets_.write_i32v(call_position - last_asm_source_position_);
+
+ DCHECK_GE(to_number_position, 0);
+ asm_offsets_.write_i32v(to_number_position - call_position);
+ last_asm_source_position_ = to_number_position;
}
void WasmFunctionBuilder::WriteSignature(ZoneBuffer& buffer) const {
« no previous file with comments | « src/wasm/wasm-module-builder.h ('k') | src/wasm/wasm-objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698