Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Scan-build contradicting assumption #37182

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR38209
Status NEW
Importance P enhancement
Reported by kpop (Koen.Poppe@vandewiele.com)
Reported on 2018-07-18 04:11:04 -0700
Last modified on 2018-07-18 04:11:59 -0700
Version 6.0
Hardware All All
CC llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments main.cpp (1171 bytes, text/plain)
report.zip (11268 bytes, application/zip)
Blocks
Blocked by
See also
Created attachment 20567
Minimal example illustrating contradicting assumptions

Running scan-build-6.0 on the attached code results in contradicting
assumptions:

Step 2) Assuming 'empty()' is false
Step 5) Assuming 'empty()' is true

Workaround (enable the WORKAROUND define) allows scan-build to reason about
memberPlus100 locally thus avoiding this false positive.

Should scan-build be able to reason about this, knowing that both 'empty()'
calls should result in the same outcome?
Quuxplusone commented 6 years ago

Attached main.cpp (1171 bytes, text/plain): Minimal example illustrating contradicting assumptions

Quuxplusone commented 6 years ago

Attached report.zip (11268 bytes, application/zip): Report of the attached C++ file