Backed out changeset 0721462a8e28 (bug 1855425) for causing Spider-monkey assertion failures at js/src/wasm/WasmStubs.cpp CLOSED TREE

This commit is contained in:
Sandor Molnar 2023-12-08 06:25:25 +02:00
parent 3641e9e2b1
commit ca78629099
2 changed files with 0 additions and 24 deletions

View file

@ -1,4 +0,0 @@
var { table } = wasmEvalText(`
(module (func $add) (table (export "table") 10 funcref) (elem (i32.const 0) $add))
`).exports
table.get(0)();

View file

@ -607,28 +607,8 @@ static bool GenerateInterpEntry(MacroAssembler& masm, const FuncExport& fe,
AutoCreatedBy acb(masm, "GenerateInterpEntry");
AssertExpectedSP(masm);
// UBSAN expects that the word before a C++ function pointer is readable for
// some sort of generated assertion.
//
// These interp entry points can sometimes be output at the beginning of a
// code page allocation, which will cause access violations when called with
// UBSAN enabled.
//
// Insert some padding in this case by inserting a breakpoint before we align
// our code. This breakpoint will misalign the code buffer (which was aligned
// due to being at the beginning of the buffer), which will then be aligned
// and have at least one word of padding before this entry point.
if (masm.currentOffset() == 0) {
masm.breakpoint();
}
masm.haltingAlign(CodeAlignment);
// Double check that the first word is available for UBSAN; see above.
static_assert(CodeAlignment >= sizeof(uintptr_t));
MOZ_ASSERT(masm.currentOffset() >= sizeof(uintptr_t));
offsets->begin = masm.currentOffset();
// Save the return address if it wasn't already saved by the call insn.