Hi LLVM developers,
When I use analyzer to static analysis k3b for detecting Memory-leak, Use-after-free and sort of issues, it segfault! so I debug the analyzer to fix the issue.
Testcase:
clang++ -cc1 -triple x86_64-isoft-linux -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name k3bdevice.cpp -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-eagerly-assume -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -resource-dir /usr/lib/clang/5.0.0 -isystem /usr/local/include -D HAVE_QT5WEBKITWIDGETS -D KCOREADDONS_LIB -D QT_CORE_LIB -D QT_NO_DEBUG -D QT_NO_URL_CAST_FROM_STRING -D _GNU_SOURCE -D _LARGEFILE64_SOURCE -D k3bdevice_EXPORTS -internal-isystem /usr/local/include -internal-isystem /usr/lib/clang/5.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-long-long -std=gnu++11 -fdeprecated-macro -ferror-limit 19 -fmessage-length 0 -fvisibility hidden -fvisibility-inlines-hidden -fno-operator-names -fobjc-runtime=gcc -fdiagnostics-show-option -x c++ k3bdevice.cpp
Because the preprocessed fileSize is 2.3MB, please download it. and review my patch, thanks a lot!
Regards,
Leslie Zhai