[cfe-commits] r68686 - /cfe/trunk/lib/Analysis/GRExprEngine.cpp
Ted Kremenek
kremenek at apple.com
Wed Apr 8 23:02:07 PDT 2009
Author: kremenek
Date: Thu Apr 9 01:02:06 2009
New Revision: 68686
URL: http://llvm.org/viewvc/llvm-project?rev=68686&view=rev
Log:
Fix a null pointer dereference error due to state caching in a loop involving
sending a message to a nil receiver.
Modified:
cfe/trunk/lib/Analysis/GRExprEngine.cpp
Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=68686&r1=68685&r2=68686&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Thu Apr 9 01:02:06 2009
@@ -1704,10 +1704,8 @@
N->markAsSink();
if (isFeasibleNotNull)
NilReceiverStructRetImplicit.insert(N);
- else {
+ else
NilReceiverStructRetExplicit.insert(N);
- return;
- }
}
}
}
@@ -1725,10 +1723,8 @@
N->markAsSink();
if(isFeasibleNotNull)
NilReceiverLargerThanVoidPtrRetImplicit.insert(N);
- else {
+ else
NilReceiverLargerThanVoidPtrRetExplicit.insert(N);
- return;
- }
}
}
else if (!isFeasibleNotNull) {
@@ -1753,7 +1749,10 @@
}
}
// We have handled the cases where the receiver is nil. The remainder
- // of this method should assume that the receiver is not nil.
+ // of this method should assume that the receiver is not nil.
+ if (!StNotNull)
+ return;
+
state = StNotNull;
}
More information about the cfe-commits
mailing list