[LLVMbugs] [Bug 7340] New: Analyzer crash due to unsupported statement

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jun 9 20:01:14 CDT 2010


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

           Summary: Analyzer crash due to unsupported statement
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: reif at earthlink.net
                CC: llvmbugs at cs.uiuc.edu


The following code:

#include <string>

void foo(const std::string &s)
{
    std::string _str = s;

    bool b = bool(_str[0] == '_' || std::isalpha(_str[0]));
}

int main()
{
    return 0;
}

produces this:

$ clang++ --analyze test.cpp
test.cpp:7:10: warning: Value stored to 'b' during its initialization is never
read
    bool b = bool(_str[0] == '_' || std::isalpha(_str[0]));
         ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clang:
/home/reif/clang/llvm/tools/clang/lib/Checker/../../include/clang/Checker/PathSensitive/CheckerVisitor.h:41:
void clang::CheckerVisitor<ImplClass>::PreVisit(clang::CheckerContext&, const
clang::Stmt*) [with ImplClass = <unnamed>::AdjustedReturnValueChecker]:
Assertion `false && "Unsupport statement."' failed.
0  clang     0x090e38e0
1  clang     0x090e3778
2            0x00b45400 __kernel_sigreturn + 0
3  libc.so.6 0x0013da82 abort + 386
4  libc.so.6 0x00133718 __assert_fail + 248
5  clang     0x085a15ef
6  clang     0x085a156d
7  clang     0x0854d79c
8  clang     0x0853b6f2
9  clang     0x085447c2
10 clang     0x0853dbb8
11 clang     0x085450ec
12 clang     0x0853db32
13 clang     0x0853d2f4
14 clang     0x085356e6
15 clang     0x0853653d
16 clang     0x08535bb3
17 clang     0x081662b8
18 clang     0x0816330b
19 clang     0x08163402
20 clang     0x08163488
21 clang     0x08163075
22 clang     0x08162ade
23 clang     0x082f38e7
24 clang     0x08098a2a
25 clang     0x08098693
26 clang     0x08084c14
27 clang     0x0804ec2f
28 clang     0x0805754b main + 365
29 libc.so.6 0x00126bd6 __libc_start_main + 230
30 clang     0x0804d5e1
Stack dump:
0.    Program arguments: /usr/local/bin/clang -cc1 -triple i386-pc-linux-gnu
-analyze -disable-free -main-file-name test.cpp -analyzer-store=region
-analyzer-opt-analyze-nested-blocks -analyzer-check-dead-stores
-analyzer-check-objc-mem -analyzer-eagerly-assume
-analyzer-check-objc-methodsigs -analyzer-check-objc-unused-ivars
-analyzer-output plist -w -mrelocation-model static -mdisable-fp-elim
-mconstructor-aliases -target-cpu pentium4 -resource-dir
/usr/local/lib/clang/2.0 -ferror-limit 19 -fmessage-length 207 -fexceptions
-fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o test.plist -x
c++ test.cpp 
1.    <eof> parser at end of file
2.    test.cpp:7:5: Error evaluating statement
3.    test.cpp:7:5: Error evaluating statement
4.    test.cpp:7:14: Error evaluating statement
clang: error: clang frontend command failed due to signal 6 (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 LLVMbugs mailing list