Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Invalid analysis path with bitfields #17537

Open Quuxplusone opened 11 years ago

Quuxplusone commented 11 years ago
Bugzilla Link PR17538
Status NEW
Importance P normal
Reported by michael.morrell@intel.com
Reported on 2013-10-10 14:58:24 -0700
Last modified on 2013-10-14 13:10:41 -0700
Version unspecified
Hardware Macintosh MacOS X
CC jrose@belkadan.com, llvm-bugs@lists.llvm.org, michael.morrell@intel.com
Fixed by commit(s)
Attachments invalidpath.cpp (560 bytes, application/octet-stream)
Blocks
Blocked by
See also
Created attachment 11357
Source showing problem

Version 275 of the Mac OS X checker gives an incorrect "null dereference" error
on the attached source.  Just run "checker-275/scan-build c++ -c
invalidpath.cpp"
and look at the path it analyzed.

It took a path where retValue.Success was false, but then immediately went down
a
patch where it was true, which is impossible.

The really weird part is that if you swap the first 2 lines in the "foo"
function, the error isn't reported.

Another weirdness is that retValue is initialized in such a way that
retValue.Success is true so that the path where it assumed it was false is not
possible either.
Quuxplusone commented 11 years ago

Attached invalidpath.cpp (560 bytes, application/octet-stream): Source showing problem

Quuxplusone commented 11 years ago
The analyzer pretty much doesn't handle bitfields at all. *sigh*
Quuxplusone commented 11 years ago

Agreed that's unfortunate. However, I think our codebase uses bitfields quite a bit and I haven't noticed too many analyzer issues relating to them. I hope this can get fixed.