forked from OSchip/llvm-project
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?) llvm-svn: 113480
This commit is contained in:
parent
269f322110
commit
230ddf37af
|
@ -51,7 +51,7 @@ void ArrayBoundChecker::VisitLocation(CheckerContext &C, const Stmt *S, SVal l){
|
|||
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();
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ const GRState *CStringChecker::CheckLocation(CheckerContext &C,
|
|||
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);
|
||||
|
|
|
@ -59,7 +59,7 @@ void ReturnPointerRangeChecker::PreVisitReturnStmt(CheckerContext &C,
|
|||
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.
|
||||
|
|
Loading…
Reference in New Issue