Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

New type casting bug #6487

Closed Quuxplusone closed 14 years ago

Quuxplusone commented 14 years ago
Bugzilla Link PR6013
Status RESOLVED DUPLICATE of bug 6035
Importance P normal
Reported by Andy Wick (andy.wick@corp.aol.com)
Reported on 2010-01-12 11:56:57 -0800
Last modified on 2010-02-22 12:51:47 -0800
Version trunk
Hardware PC Linux
CC kremenek@apple.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
This was introduced between 93136 and 93238

The file only needs to contain:
void test (void *uw1) {
    unsigned int foo;
    foo = ((long)(uw1));
}

clang --analyze test.c

clang: SValuator.cpp:119: clang::SValuator::CastResult
clang::SValuator::EvalCast(clang::SVal, const clang::GRState*, clang::QualType,
clang::QualType): Assertion `Loc::IsLocType(castTy)' failed.
0  clang           0x000000000142a77f
1  clang           0x000000000142af81
2  libpthread.so.0 0x0000002a9567f160
3  libc.so.6       0x0000002a95d5f745 gsignal + 69
4  libc.so.6       0x0000002a95d60eb3 abort + 467
5  libc.so.6       0x0000002a95d58dc9
6  clang           0x00000000006c057e
7  clang           0x000000000067efcf
8  clang           0x0000000000679ac4
9  clang           0x0000000000679fe8
10 clang           0x0000000000679a54
11 clang           0x0000000000680bfd
12 clang           0x000000000066e708
13 clang           0x000000000066e972
14 clang           0x00000000004d9b2f
15 clang           0x00000000004d84d0
16 clang           0x00000000004d89b5
17 clang           0x00000000006e39f6
18 clang           0x00000000004347c8
19 clang           0x0000000000437851 main + 1585
20 libc.so.6       0x0000002a95d4d1d7 __libc_start_main + 215
21 clang           0x000000000043263a
Stack dump:
0.    Program arguments: /usr/local/bin/clang -cc1 -triple x86_64-unknown-linux-
gnu -analyze -disable-free -main-file-name test.c -analyzer-store=region -
analyzer-opt-analyze-nested-blocks -warn-dead-stores -warn-security-syntactic -
checker-cfref -analyzer-eagerly-assume -warn-objc-methodsigs -warn-objc-unused-
ivars -analyzer-output plist -mrelocation-model static -mdisable-fp-elim -
munwind-tables -target-cpu x86-64 -v -resource-dir /usr/local/lib/clang/1.1 -
fmessage-length 166 -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics
-o test.plist -x c test.c
1.    <eof> parser at end of file
2.    test.c:3:5: Error evaluating statement
3.    test.c:3:5: Error evaluating statement
4.    test.c:3:11: Error evaluating statement
Quuxplusone commented 14 years ago

This is the same as 6035, which has now been fixed (this was a simpler test case).

_This bug has been marked as a duplicate of bug 6035_