From 9735d7f1095efa3be8a289937d70d93bab7b24ad Mon Sep 17 00:00:00 2001 From: Deepti Gandluri Date: Thu, 3 Aug 2017 15:15:45 -0700 Subject: [PATCH] [wasm] Fix link error messages to be more indicative of the actual error R=mtrofin@chromium.org Change-Id: I665065b7e1161bcef6315a03083437410c574755 Reviewed-on: https://chromium-review.googlesource.com/601174 Commit-Queue: Deepti Gandluri Reviewed-by: Mircea Trofin Cr-Commit-Position: refs/heads/master@{#47148} --- src/wasm/module-compiler.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/wasm/module-compiler.cc b/src/wasm/module-compiler.cc index 5c5314eac1..4025c1b549 100644 --- a/src/wasm/module-compiler.cc +++ b/src/wasm/module-compiler.cc @@ -1336,9 +1336,9 @@ int InstanceBuilder::ProcessImports(Handle code_table, } if (imported_max_size > table.max_size) { thrower_->LinkError( - "table import %d has maximum larger than maximum %d, " - "got %" PRIx64, - index, table.max_size, imported_max_size); + "memory import %d has a larger maximum size %" PRIx64 + " than the module's declared maximum %u", + index, imported_max_size, table.max_size); return -1; } } @@ -1404,8 +1404,9 @@ int InstanceBuilder::ProcessImports(Handle code_table, if (static_cast(imported_max_pages) > module_->max_mem_pages) { thrower_->LinkError( - "memory import %d has larger maximum than maximum %u, got %d", - index, module_->max_mem_pages, imported_max_pages); + "memory import %d has a larger maximum size %u than the " + "module's declared maximum %u", + index, imported_max_pages, module_->max_mem_pages); return -1; } }