Update typestate logic to support GC-mode.

llvm-svn: 50396
This commit is contained in:
Ted Kremenek 2008-04-29 05:44:10 +00:00
parent 4b7ca776cf
commit a374ea9a35
1 changed files with 8 additions and 3 deletions

View File

@ -1288,7 +1288,7 @@ CFRefCount::RefBindings CFRefCount::Update(RefBindings B, SymbolID sym,
assert (false && "Unhandled CFRef transition.");
case DoNothing:
if (V.getKind() == RefVal::Released) {
if (!GCEnabled && V.getKind() == RefVal::Released) {
V = RefVal::makeUseAfterRelease();
hasErr = V.getKind();
break;
@ -1310,8 +1310,13 @@ CFRefCount::RefBindings CFRefCount::Update(RefBindings B, SymbolID sym,
break;
case RefVal::Released:
V = RefVal::makeUseAfterRelease();
hasErr = V.getKind();
if (GCEnabled)
V = RefVal::makeOwned();
else {
V = RefVal::makeUseAfterRelease();
hasErr = V.getKind();
}
break;
}