[analyzer] Fixup for r162935 as per Jordan's review.

Thanks for catching this!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162949 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
index 9ba2f8c..953527d 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
@@ -102,7 +102,7 @@
 
   /// Returns true if the predecessor is within an inlined function/method.
   bool isWithinInlined() {
-    return (getStackFrame() != 0);
+    return (getStackFrame()->getParent() != 0);
   }
 
   BugReporter &getBugReporter() {
diff --git a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
index e5fbb83..cfb35a4 100644
--- a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
+++ b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
@@ -736,9 +736,9 @@
                                     ProgramStateRef State,
                                     CheckerContext &C) {
   SVal Val = State->getSVal(NonNullExpr, C.getLocationContext());
-  if (!isa<DefinedOrUnknownSVal>(Val))
-    return State;
-  return State->assume(cast<DefinedOrUnknownSVal>(Val), true);
+  if (DefinedOrUnknownSVal *DV = dyn_cast<DefinedOrUnknownSVal>(&Val))
+    return State->assume(cast<DefinedOrUnknownSVal>(*DV), true);
+  return State;
 }
 
 void ObjCNonNilReturnValueChecker::checkPostObjCMessage(const ObjCMethodCall &M,
diff --git a/test/Analysis/inlining/assume-super-init-does-not-return-nil.m b/test/Analysis/inlining/assume-super-init-does-not-return-nil.m
index d17835e..cda1e87 100644
--- a/test/Analysis/inlining/assume-super-init-does-not-return-nil.m
+++ b/test/Analysis/inlining/assume-super-init-does-not-return-nil.m
@@ -24,7 +24,7 @@
 @implementation Cell
 - (id) init {
   if ((self = [super init])) {
-    ;
+    return self;
   }
   // Test that this is being analyzed.
   int m;