[LLVMbugs] [Bug 9287] New: Assert when analyzing "ternary operator" without second operator

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Feb 22 03:57:07 PST 2011


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

           Summary: Assert when analyzing "ternary operator" without
                    second operator
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: devlists at shadowlab.org
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=6206)
 --> (http://llvm.org/bugs/attachment.cgi?id=6206)
reduced case

clang crash when trying to analyze this reduced case:

-----
int test(int type) { return type ? : 0; }
-----

% clang --analyze ternary.c 
Assertion failed: (B->succ_size() == 2), function HandleBranch, file
/Volumes/MacPro/Projects/OpenSource/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp,
line 429.
0  clang             0x0000000100f200a2 PrintStackTrace(void*) + 34
1  clang             0x0000000100f205f9 SignalHandler(int) + 745
2  libSystem.B.dylib 0x00007fff82f6e67a _sigtramp + 26
3  libSystem.B.dylib 0x0000000102012d50 _sigtramp + 2131379952
4  clang             0x0000000100011a16 abort + 22
5  clang             0x00000001000119d8 __assert_rtn + 56
6  clang             0x0000000100526770
clang::ento::CoreEngine::HandleBlockExit(clang::CFGBlock const*,
clang::ento::ExplodedNode*) + 1776
7  clang             0x0000000100525d68
clang::ento::CoreEngine::HandlePostStmt(clang::CFGBlock const*, unsigned int,
clang::ento::ExplodedNode*) + 72
8  clang             0x0000000100525401
clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*,
unsigned int, clang::ento::GRState const*) + 481
9  clang             0x000000010049ff73 ActionObjCMemCheckerAux((anonymous
namespace)::AnalysisConsumer&, clang::ento::AnalysisManager&, clang::Decl*,
bool) + 1123
[…]
21 clang             0x000000000000002b start + 4294893883
Stack dump:
0.    Program arguments:
/Volumes/MacPro/Projects/OpenSource/llvm/release/Release+Asserts/bin/clang -cc1
-triple x86_64-apple-darwin10.0.0 -analyze -disable-free -main-file-name
ternary.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks
-analyzer-checker=core -analyzer-checker=unix -analyzer-checker=macosx
-analyzer-check-objc-mem -analyzer-eagerly-assume -analyzer-output plist -w
-pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2
-target-linker-version 97.17 -resource-dir
/Volumes/MacPro/Projects/OpenSource/llvm/release/Release+Asserts/bin/../lib/clang/2.9
-ferror-limit 19 -fmessage-length 262 -stack-protector 1 -fblocks
-fdiagnostics-show-option -fcolor-diagnostics -o ternary.plist -x c ternary.c 
1.    <eof> parser at end of file
clang: error: unable to execute command: Illegal instruction
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list