1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

[asan] Fix x86-32 asm instrumentation to preserve flags.

Patch by Yuri Gorshenin.

llvm-svn: 209280
This commit is contained in:
Evgeniy Stepanov 2014-05-21 08:14:24 +00:00
parent 580c4aecc3
commit d57ad51b22

View File

@ -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));
}