Verified Commit 463c059d authored by André Bargull's avatar André Bargull Committed by ma1
Browse files

Bug 2045482: Align with hasSpaceForInsts to simplify test case. r=jandem a=RyanVM DONTBUILD

Align with `hasSpaceForInsts` so the test case doesn't need to emit
thirty additional nop instructions.

Differential Revision: https://phabricator.services.mozilla.com/D306374
parent e3494a02
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -949,9 +949,10 @@ struct AssemblerBufferWithConstantPools
    // with our expected reserved bytes.
    size_t deadline = branchDeadlines_.earliestDeadline().getOffset();
    using CheckedSize = mozilla::CheckedInt<size_t>;
    CheckedSize current(this->nextOffset().getOffset());
    CheckedSize nextOffset(sizeExcludingCurrentPool());
    CheckedSize poolOffset = nextOffset + (guardSize_ + headerSize_) * InstSize;
    CheckedSize poolFreeSpace(reservedBytes);
    auto future = current + poolFreeSpace;
    auto future = poolOffset + poolFreeSpace;
    return !future.isValid() || deadline < future.value();
  }