[llvm-bugs] [Bug 43163] New: Calling main() not identified as undefined behavior

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 29 06:45:53 PDT 2019


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

            Bug ID: 43163
           Summary: Calling main() not identified as undefined behavior
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jeff.linahan at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

// ubtest.cpp
int main() {main();}

Compiling with "clang++ -fsanitize=undefined ubtest.cpp -o ubtest.exe"

In C++ calling main() is UB so I'd expect UBSan to immediately detect the nasal
demons invoked but this actually stack overflows after 250 calls on Ubuntu.

-- 
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/20190829/1e0a1fa6/attachment.html>


More information about the llvm-bugs mailing list