Merge pull request #2463 from cfallin/fix-heap-bounds-check-x64

x64 backend: fix condition-code used for part of explicit heap check.
This commit is contained in:
Chris Fallin
2020-12-02 11:24:54 -08:00
committed by GitHub
2 changed files with 29 additions and 6 deletions

View File

@@ -92,15 +92,15 @@ impl MachBackend for X64Backend {
}
fn unsigned_add_overflow_condition(&self) -> IntCC {
// Unsigned `>=`; this corresponds to the carry flag set on x86, which happens on
// overflow of an add.
IntCC::UnsignedGreaterThanOrEqual
// Unsigned `<`; this corresponds to the carry flag set on x86, which
// indicates an add has overflowed.
IntCC::UnsignedLessThan
}
fn unsigned_sub_overflow_condition(&self) -> IntCC {
// unsigned `>=`; this corresponds to the carry flag set on x86, which happens on
// underflow of a subtract (carry is borrow for subtract).
IntCC::UnsignedGreaterThanOrEqual
// unsigned `<`; this corresponds to the carry flag set on x86, which
// indicates a sub has underflowed (carry is borrow for subtract).
IntCC::UnsignedLessThan
}
#[cfg(feature = "unwind")]