[LLVMbugs] [Bug 22686] New: Wrong getUBSanFunctionSignature for x32

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Feb 24 15:31:24 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=22686

            Bug ID: 22686
           Summary: Wrong getUBSanFunctionSignature for x32
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hjl.tools at gmail.com
                CC: llvmbugs at cs.uiuc.edu, michael.m.kuperstein at intel.com
    Classification: Unclassified

lib/CodeGen/TargetInfo.cpp has:

  llvm::Constant *
  getUBSanFunctionSignature(CodeGen::CodeGenModule &CGM) const override {
    unsigned Sig = (0xeb << 0) |  // jmp rel8
                   (0x0a << 8) |  //           .+0x0c
                   ('F' << 16) |
                   ('T' << 24); 
    return llvm::ConstantInt::get(CGM.Int32Ty, Sig);
  }

But label is 4 bytes for x32.  That is

.long    _ZTIFvvE

vs.

.quad    _ZTIFvvE

For x32, it should be

   unsigned Sig = (0xeb << 0) |  // jmp rel8
                   (0x06 << 8) |  //           .+0x08
                   ('F' << 16) |
                   ('T' << 24);

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150224/540aa35b/attachment.html>


More information about the llvm-bugs mailing list