Skip to content

Commit

Permalink
[asan] Fix x86-32 asm instrumentation to preserve flags.
Browse files Browse the repository at this point in the history
Patch by Yuri Gorshenin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209280 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
eugenis committed May 21, 2014
1 parent 8235ed1 commit c0e6693
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ void X86AddressSanitizer32::InstrumentMemOperandImpl(
MCSymbolRefExpr::Create(FuncSym, MCSymbolRefExpr::VK_PLT, Ctx);
EmitInstruction(Out, MCInstBuilder(X86::CALLpcrel32).addExpr(FuncExpr));
}
EmitInstruction(Out, MCInstBuilder(X86::ADD32ri).addReg(X86::ESP)
.addReg(X86::ESP).addImm(4));
EmitInstruction(Out, MCInstBuilder(X86::POP32r).addReg(X86::EAX));
EmitInstruction(Out, MCInstBuilder(X86::POP32r).addReg(X86::EAX));
}

Expand Down

0 comments on commit c0e6693

Please sign in to comment.