llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.83k stars 11.46k forks source link

Analyzer misses writes to invalid memory #26146

Open llvmbot opened 8 years ago

llvmbot commented 8 years ago
Bugzilla Link 25772
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor

Extended Description

Pointers are kept to some objects on the stack. Once the lifetime of those objects end, the pointers are used to write to that memory.

$ scan-build g++ -std=c++1z write_invalid_mem.cpp scan-build: Using 'local/tmp/clang/bin/clang' for static analysis scan-build: Removing directory '/tmp/scan-build-2015-12-08-151246-7669-1' because it contains no reports. scan-build: No bugs found.

Example taken from the talk "CppCon 2015: Herb Sutter "Writing Good C++14... By Default" at 33:12

llvmbot commented 8 years ago

assigned to @tkremenek