[cfe-commits] r113480 - in /cfe/trunk/lib/Checker: ArrayBoundChecker.cpp CStringChecker.cpp ReturnPointerRangeChecker.cpp
Gabor Greif
ggreif at gmail.com
Thu Sep 9 03:51:37 PDT 2010
Author: ggreif
Date: Thu Sep 9 05:51:37 2010
New Revision: 113480
URL: http://llvm.org/viewvc/llvm-project?rev=113480&view=rev
Log:
do not bind temporaries to non-const references
this fixes all analyser test failures in my gcc34-based
environment
how the cast result could bind to the non-const ref is
somewhat mysterious and remains to be investigated; to
avoid similar miscompilations (by gcc34 only?)
Modified:
cfe/trunk/lib/Checker/ArrayBoundChecker.cpp
cfe/trunk/lib/Checker/CStringChecker.cpp
cfe/trunk/lib/Checker/ReturnPointerRangeChecker.cpp
Modified: cfe/trunk/lib/Checker/ArrayBoundChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/ArrayBoundChecker.cpp?rev=113480&r1=113479&r2=113480&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/ArrayBoundChecker.cpp (original)
+++ cfe/trunk/lib/Checker/ArrayBoundChecker.cpp Thu Sep 9 05:51:37 2010
@@ -51,7 +51,7 @@
return;
// Get the index of the accessed element.
- DefinedOrUnknownSVal &Idx = cast<DefinedOrUnknownSVal>(ER->getIndex());
+ DefinedOrUnknownSVal Idx = cast<DefinedOrUnknownSVal>(ER->getIndex());
const GRState *state = C.getState();
Modified: cfe/trunk/lib/Checker/CStringChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/CStringChecker.cpp?rev=113480&r1=113479&r2=113480&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/CStringChecker.cpp (original)
+++ cfe/trunk/lib/Checker/CStringChecker.cpp Thu Sep 9 05:51:37 2010
@@ -193,7 +193,7 @@
DefinedOrUnknownSVal Size = cast<DefinedOrUnknownSVal>(Extent);
// Get the index of the accessed element.
- DefinedOrUnknownSVal &Idx = cast<DefinedOrUnknownSVal>(ER->getIndex());
+ DefinedOrUnknownSVal Idx = cast<DefinedOrUnknownSVal>(ER->getIndex());
const GRState *StInBound = state->AssumeInBound(Idx, Size, true);
const GRState *StOutBound = state->AssumeInBound(Idx, Size, false);
Modified: cfe/trunk/lib/Checker/ReturnPointerRangeChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/ReturnPointerRangeChecker.cpp?rev=113480&r1=113479&r2=113480&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/ReturnPointerRangeChecker.cpp (original)
+++ cfe/trunk/lib/Checker/ReturnPointerRangeChecker.cpp Thu Sep 9 05:51:37 2010
@@ -59,7 +59,7 @@
if (!ER)
return;
- DefinedOrUnknownSVal &Idx = cast<DefinedOrUnknownSVal>(ER->getIndex());
+ DefinedOrUnknownSVal Idx = cast<DefinedOrUnknownSVal>(ER->getIndex());
// FIXME: All of this out-of-bounds checking should eventually be refactored
// into a common place.
More information about the cfe-commits
mailing list