[llvm-bugs] [Bug 28185] New: CFI ICall metadata is generated incorrectly for functions with void parameter

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 17 23:15:04 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=28185

            Bug ID: 28185
           Summary: CFI ICall metadata is generated incorrectly for
                    functions with void parameter
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: d.c.ddcc at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

When compiling the attached testcase with CFI ICall enabled, the metadata that
is generated is incorrect: the callsite has metadata "_ZTSFivE", and the
potential call target has metadata "_ZTSFiE". As a result, the LowerBitSets
pass in LLVM does not realize that this is a potential valid call target. But,
according to both the C and C++ specifications, functions with a single void
parameter are equivalent to the same function with an empty parameter list.

Unfortunately, I am not familiar enough with the Clang front-end to track down
the source of the bug. However, the key difference is that when
"CreateMetadataIdentifierForType(QualType(FnType, 0))" is called in
"CodeGenFunction::EmitCall()", in one instance the "FnType" variable is of type
"FunctionProtoType", whereas in the other instance it is of type
"FunctionNoProtoType". Then, when the Itanium name mangler is called at
"CXXNameMangler::mangleType()", the mangled name is represented differently.

-- 
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/20160618/0f2675a6/attachment-0001.html>


More information about the llvm-bugs mailing list