[llvm] 3f87513 - [asan] Fixed the jump to use the 4 byte offset version.

Kirill Stoimenov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 8 10:58:59 PDT 2021


Author: Kirill Stoimenov
Date: 2021-09-08T17:58:12Z
New Revision: 3f875134a7ce7285f4d5484fc0551b14076463e6

URL: https://github.com/llvm/llvm-project/commit/3f875134a7ce7285f4d5484fc0551b14076463e6
DIFF: https://github.com/llvm/llvm-project/commit/3f875134a7ce7285f4d5484fc0551b14076463e6.diff

LOG: [asan] Fixed the jump to use the 4 byte offset version.

This should have been the 4 byte version in the first place. Unfortunatelly there is no easy way to add a test as both the 1 byte and 4 byte version are printed as 'jmp' in the assembly code.

Reviewed By: kda

Differential Revision: https://reviews.llvm.org/D109453

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86MCInstLower.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp
index 978fcbf8fbbe..782ed0659112 100644
--- a/llvm/lib/Target/X86/X86MCInstLower.cpp
+++ b/llvm/lib/Target/X86/X86MCInstLower.cpp
@@ -1525,7 +1525,7 @@ void X86AsmPrinter::emitAsanReportError(Module &M, unsigned Reg,
                                    .addReg(X86::NoRegister + Reg),
                                STI);
   OutStreamer->emitInstruction(
-      MCInstBuilder(X86::JMP_1)
+      MCInstBuilder(X86::JMP_4)
           .addExpr(MCSymbolRefExpr::create(ReportError, MCSymbolRefExpr::VK_PLT,
                                            OutContext)),
       STI);


        


More information about the llvm-commits mailing list