Commit 51f05798 authored by georgia.kouveli's avatar georgia.kouveli Committed by Commit bot

[wasm] Do not used "undefined" for function signature padding.

Commit d0b8e7fb introduced some functionality to allocate additional
space in the function table, filled with an "undefined" function
signature. Use -1 instead of undefined_value() as the latter can have
the top bits cleared (which happens often for arm64) and causes
intermittent test failures.

BUG=

Review-Url: https://codereview.chromium.org/2105293002
Cr-Commit-Position: refs/heads/master@{#37393}
parent 44748584
......@@ -245,6 +245,16 @@ Handle<FixedArray> BuildFunctionTable(Isolate* isolate,
&module->functions[module->function_table[i]];
fixed->set(i, Smi::FromInt(function->sig_index));
}
// Set the remaining elements to -1 (instead of "undefined"). These
// elements are accessed directly as SMIs (without a check). On 64-bit
// platforms, it is possible to have the top bits of "undefined" take
// small integer values (or zero), which are more likely to be equal to
// the signature index we check against.
for (uint32_t i = static_cast<uint32_t>(module->function_table.size());
i < table_size;
++i) {
fixed->set(i, Smi::FromInt(-1));
}
return fixed;
}
......
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