llvm / llvm-project

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

Incorrect dereference warning #16264

Open llvmbot opened 11 years ago

llvmbot commented 11 years ago
Bugzilla Link 15892
Version unspecified
OS MacOS X
Attachments Source showing problem
Reporter LLVM Bugzilla Contributor
CC @belkadan

Extended Description

I'm getting an incorrect "dereference of undefined pointer value" warning using checker-273 that didn't occur with checker-272.

Running "scan-build c++ -c bug48.cpp" produces 2 incorrect warnings.

The analysis takes a path where "token->use48" is true in the first "if" and false in the second "if" (and vice-versa) but that's not possible.

llvmbot commented 11 years ago

Since you mentioned C++, I tried a C version of the same code and it behaved the same (no issues reported with checker-272, but 2 with checker-273).

llvmbot commented 11 years ago

C version demonstrating issue

belkadan commented 11 years ago

Cloned to rdar://problem/13795277

belkadan commented 11 years ago

Hm. Recent checker builds have cracked down a bit on C++ reinterpret_cast within a class hierarchy, but I suppose this should work for a couple of reasons:

llvmbot commented 11 years ago

assigned to @tkremenek