[LLVMbugs] [Bug 8694] New: Analyzer crashes when forward enum pointer is passed as int pointer

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 25 02:01:39 PST 2010


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

           Summary: Analyzer crashes when forward enum pointer is passed
                    as int pointer
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: magnus.reftel at gmail.com
                CC: llvmbugs at cs.uiuc.edu


The following test case makes the analyzer segfault:


void sub(int* e)
{
}

void crash(enum E* e)
{
        sub(e);
}


Adding "enum E{whatever};" at the top makes the crash go away. The error
message is:


$ /opt/llvm-r120134/bin/clang --analyze -v crash.c
clang version 2.9 (trunk 120134)
Target: i386-pc-cygwin
Thread model: posix
 "/opt/llvm-r120134/bin/clang" -cc1 -triple i386-pc-cygwin -analyze
-disable-free -main-file-name crash.c -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-check-idempotent-operations -analyzer-output plist -w
-mrelocation-model static -mdisable-fp-elim -mconstructor-aliases -target-cpu
pentium4 -target-linker-version 2.20.51.20100410 -v -resource-dir
/opt/llvm-r120134/bin/../lib/clang/2.9 -ferror-limit 19 -fmessage-length 80
-fno-use-cxa-atexit -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics
-o crash.plist -x c crash.c
clang -cc1 version 2.9 based upon llvm 2.9svn hosted on i386-pc-cygwin
ignoring nonexistent directory "/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/llvm-r120134/bin/../lib/clang/2.9/include
 /usr/include/w32api
 /usr/include
End of search list.
Stack dump:
0.      Program arguments: /opt/llvm-r120134/bin/clang -cc1 -triple
i386-pc-cygwin -analyze -disable-free -main-file-name crash.c
-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-check-idempotent-operations -analyzer-output plist -w
-mrelocation-model static -mdisable-fp-elim -mconstructor-aliases -target-cpu
pentium4 -target-linker-version 2.20.51.20100410 -v -resource-dir
/opt/llvm-r120134/bin/../lib/clang/2.9 -ferror-limit 19 -fmessage-length 80
-fno-use-cxa-atexit -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics
-o crash.plist -x c crash.c
1.      crash.c:7:21: current parser token ')'
2.      crash.c:6:1: parsing function body 'crash'
3.      crash.c:6:1: in compound statement ('{}')
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)



I believe this is and old problem that was fixed about two weeks ago, but now
fails again.

-- 
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