mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-27 17:47:34 +09:00
[js, ARM] Always check error return from BufferOffset::diffB.
We were missing error checks at two points. In one case an error return is meaningful; in another case it is not, as the problem should have been guarded against at a higher level by emitting far jump islands soon enough during pasteup of compiled code.
This commit is contained in:
parent
269dfa5bac
commit
772e51c7b4
2 changed files with 10 additions and 2 deletions
|
|
@ -2401,7 +2401,12 @@ Assembler::as_b(Label* l, Condition c)
|
||||||
if (oom())
|
if (oom())
|
||||||
return BufferOffset();
|
return BufferOffset();
|
||||||
|
|
||||||
as_b(BufferOffset(l).diffB<BOffImm>(ret), c, ret);
|
BOffImm off = BufferOffset(l).diffB<BOffImm>(ret);
|
||||||
|
if (off.isInvalid()) {
|
||||||
|
m_buffer.fail_bail();
|
||||||
|
return BufferOffset();
|
||||||
|
}
|
||||||
|
as_b(off, c, ret);
|
||||||
#ifdef JS_DISASM_ARM
|
#ifdef JS_DISASM_ARM
|
||||||
spewBranch(m_buffer.getInstOrNull(ret), l);
|
spewBranch(m_buffer.getInstOrNull(ret), l);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -5012,7 +5012,10 @@ void
|
||||||
MacroAssembler::patchCall(uint32_t callerOffset, uint32_t calleeOffset)
|
MacroAssembler::patchCall(uint32_t callerOffset, uint32_t calleeOffset)
|
||||||
{
|
{
|
||||||
BufferOffset inst(callerOffset - 4);
|
BufferOffset inst(callerOffset - 4);
|
||||||
as_bl(BufferOffset(calleeOffset).diffB<BOffImm>(inst), Always, inst);
|
BOffImm off = BufferOffset(calleeOffset).diffB<BOffImm>(inst);
|
||||||
|
MOZ_RELEASE_ASSERT(!off.isInvalid(),
|
||||||
|
"Failed to insert necessary far jump islands");
|
||||||
|
as_bl(off, Always, inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeOffset
|
CodeOffset
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue