r205327 - [analyzer] Remove incorrect workaround for unimplemented temporary destructors.

Jordan Rose jordan_rose at apple.com
Tue Apr 1 09:39:59 PDT 2014


Author: jrose
Date: Tue Apr  1 11:39:59 2014
New Revision: 205327

URL: http://llvm.org/viewvc/llvm-project?rev=205327&view=rev
Log:
[analyzer] Remove incorrect workaround for unimplemented temporary destructors.

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!

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
    cfe/trunk/test/Analysis/dtor-cxx11.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp?rev=205327&r1=205326&r2=205327&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp Tue Apr  1 11:39:59 2014
@@ -91,12 +91,6 @@ void ExprEngine::performTrivialCopy(Node
 /// 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();
 

Modified: cfe/trunk/test/Analysis/dtor-cxx11.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/dtor-cxx11.cpp?rev=205327&r1=205326&r2=205327&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/dtor-cxx11.cpp (original)
+++ cfe/trunk/test/Analysis/dtor-cxx11.cpp Tue Apr  1 11:39:59 2014
@@ -8,8 +8,8 @@ namespace Cxx11BraceInit {
     ~Foo() {}
   };
 
-  /* FIXME: Don't crash here.
   void testInitializerList() {
     for (Foo foo : {Foo(), Foo()}) {}
-  } */
+  }
 }
+





More information about the cfe-commits mailing list