[LLVMbugs] [Bug 21498] New: UBSan: check size/type mismatch of global variables across modules

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 6 01:45:47 PST 2014


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

            Bug ID: 21498
           Summary: UBSan: check size/type mismatch of global variables
                    across modules
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: y.gribov at samsung.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

C99 states that declaring same global variable with incompatible types in
different units of translation is undefined behavior (6.7.5.2 item 6). So e.g.
having int a[10]; in tmp.c and int a[100]; in tmp2.c would be a UB. We should
be able to check this easily by registering all referenced globals in .c in
libubsan via callbacks at program start. Libubsan could than find size/type
mismatches and report warning.

-- 
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/20141106/f486d352/attachment.html>


More information about the llvm-bugs mailing list