If we're trying to get the zero element region of something that's not a region,
we should be returning UnknownVal, which is what ProgramState::getLValue will
do for us.
Patch by Alex McCarthy!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205327
91177308-0d34-0410-b5e6-
96231b3b80d8
/// If the type is not an array type at all, the original value is returned.
static SVal makeZeroElementRegion(ProgramStateRef State, SVal LValue,
QualType &Ty) {
- // FIXME: This check is just a temporary workaround, because
- // ProcessTemporaryDtor sends us NULL regions. It will not be necessary once
- // we can properly process temporary destructors.
- if (!LValue.getAsRegion())
- return LValue;
-
SValBuilder &SVB = State->getStateManager().getSValBuilder();
ASTContext &Ctx = SVB.getContext();
~Foo() {}
};
- /* FIXME: Don't crash here.
void testInitializerList() {
for (Foo foo : {Foo(), Foo()}) {}
- } */
+ }
}
+