Merge pull request #1930 from cfallin/spectre-heap

Spectre mitigation on heap access overflow checks.
This commit is contained in:
Chris Fallin
2020-07-01 09:23:04 -07:00
committed by GitHub
9 changed files with 148 additions and 47 deletions

View File

@@ -1023,7 +1023,7 @@ pub(crate) fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
// Nothing.
}
Opcode::Select | Opcode::Selectif => {
Opcode::Select | Opcode::Selectif | Opcode::SelectifSpectreGuard => {
let cond = if op == Opcode::Select {
let (cmp_op, narrow_mode) = if ty_bits(ctx.input_ty(insn, 0)) > 32 {
(ALUOp::SubS64, NarrowValueMode::ZeroExtend64)