[g-arc-opts] Perform sanity check that we do not merge Argument paths with non-Argument tracking paths correctly.

This was a sanity check that I through in that makes sure that we do not
try to merge together an @owned argument we are tracking with an
instruction.

rdar://17634697



Swift SVN r19967
This commit is contained in:
Michael Gottesman
2014-07-15 01:55:19 +00:00
parent 8a9b9fdd60
commit aa7f8f46d6
2 changed files with 26 additions and 6 deletions

View File

@@ -238,12 +238,11 @@ bool TopDownRefCountState::merge(const TopDownRefCountState &Other) {
}
// We should never have an argument path merge with a non-argument path.
if (!Argument.isNull()) {
RefCountState<TopDownRefCountState>::clear();
DEBUG(
llvm::dbgs() << " Can not merge Argument with Non-Argument "
"path... Bailing!\n");
return false;
if (Argument.isNull() != Other.Argument.isNull()) {
RefCountState<TopDownRefCountState>::clear();
DEBUG(llvm::dbgs() << " Can not merge Argument with "
"Non-Argument path... Bailing!\n");
return false;
}
Increments.insert(Other.Increments.begin(), Other.Increments.end());