llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

False positive: impossible path

Open llvmbot opened this issue 14 years ago • 9 comments

Bugzilla Link 13426
Resolution FIXED
Resolved on Jun 15, 2020 08:40
Version 3.1
OS FreeBSD
Reporter LLVM Bugzilla Contributor
CC @ASDenysPetrov,@AnnaZaks

Extended Description

When running the analyzer against OpenAFS git master, vlserver/vl_utils.c reports a false uninitialized argument as shown here: http://hergotha.csail.mit.edu/~analyzer/2012-07-20-1/report-8QtTSW.html#EndPath If nextblockindex == blockindex is false (#3), then clearly the loop must execute at least once (#4), causing prevblockindex to be initialized (line 929).

clang version 3.1 (branches/release_31) Target: amd64-portbld-freebsd8.3 Thread model: posix

llvmbot avatar Jul 21 '12 05:07 llvmbot

mentioned in issue llvm/llvm-bugzilla-archive#27674

devincoughlin avatar Nov 26 '21 21:11 devincoughlin

Fixed by https://reviews.llvm.org/D78933

ghost avatar Jun 15 '20 15:06 ghost

Confirmed. Proposed a fix https://reviews.llvm.org/D78933

ghost avatar May 05 '20 15:05 ghost

*** Bug llvm/llvm-bugzilla-archive#27674 has been marked as a duplicate of this bug. ***

devincoughlin avatar May 08 '16 19:05 devincoughlin

Actually, this is already tracked by radar://7670487

AnnaZaks avatar Oct 06 '12 03:10 AnnaZaks

This could be addressed with alpha-renaming. Opened radar://12447480 for internal tracking.

AnnaZaks avatar Oct 06 '12 03:10 AnnaZaks

Here's a similar one with less/greater:

int *test(int x, int y) { int i; if (x >= y) { i = 0; } else { if (x < y) { i = 1; }
}
return i; }

And with a while-loop instead:

int *test(int x, int y) { int i; if (x >= y) { i = 0; } while (x < y) { i = 1; break; } return i; }

llvmbot avatar Oct 01 '12 10:10 llvmbot

Reproducible with:

int foo(int y, int z) { int x; if (y == z) { x = 0; } else { if (y != z) { x = 1; } } return x; }

Cloned to radar://11928676

AnnaZaks avatar Jul 21 '12 08:07 AnnaZaks

assigned to @ASDenysPetrov

llvmbot avatar Jul 21 '12 05:07 llvmbot