Commit a5332b49 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm][cleanup] Fix iteration in ValidateSequentially

No need to iterate over imported functions just to skip them in the
loop body anyway.

R=mstarzinger@chromium.org

Bug: v8:7754
Change-Id: I8dabf8d6ee7d0cc029b6236cef319cf8e70e4a5b
Reviewed-on: https://chromium-review.googlesource.com/1125802Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54206}
parent 12b47ec6
......@@ -738,9 +738,10 @@ void ValidateSequentially(Isolate* isolate, NativeModule* native_module,
ModuleWireBytes wire_bytes(native_module->wire_bytes());
const WasmModule* module = native_module->module();
for (uint32_t i = 0; i < module->functions.size(); ++i) {
uint32_t start = module->num_imported_functions;
uint32_t end = start + module->num_declared_functions;
for (uint32_t i = start; i < end; ++i) {
const WasmFunction& func = module->functions[i];
if (func.imported) continue;
const byte* base = wire_bytes.start();
FunctionBody body{func.sig, func.code.offset(), base + func.code.offset(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment