[PATCH] [asan-assembly-instrumentation] Fixed operations with esp for x86-32.

Yuri Gorshenin ygorshenin at chromium.org
Tue May 20 06:40:44 PDT 2014


Hi eugenis,

[asan-assembly-instrumentation] Fixed operations with esp for x86-32.

http://reviews.llvm.org/D3846

Files:
  lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp

Index: lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp
===================================================================
--- lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp
+++ lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp
@@ -161,8 +161,7 @@
         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));
 }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3846.9618.patch
Type: text/x-patch
Size: 684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140520/d3c83ea5/attachment.bin>


More information about the llvm-commits mailing list