summaryrefslogtreecommitdiff
path: root/lib/Bytecode
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-11-03 03:27:53 +0000
committerChris Lattner <sabre@nondot.org>2001-11-03 03:27:53 +0000
commite244a2501478c68864a5a9c54718788bdd649b77 (patch)
tree47c538b334d24b0d496385c665e3c40f2dc8eeaa /lib/Bytecode
parent2d3e8bba628843bf2dffa21f69d9b45098d3bfc4 (diff)
downloadllvm-e244a2501478c68864a5a9c54718788bdd649b77.tar.gz
llvm-e244a2501478c68864a5a9c54718788bdd649b77.tar.bz2
llvm-e244a2501478c68864a5a9c54718788bdd649b77.tar.xz
Fix major bugs in type resolution
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1092 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r--lib/Bytecode/Reader/ConstantReader.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Bytecode/Reader/ConstantReader.cpp b/lib/Bytecode/Reader/ConstantReader.cpp
index fcf92fa536..ec39a9f64c 100644
--- a/lib/Bytecode/Reader/ConstantReader.cpp
+++ b/lib/Bytecode/Reader/ConstantReader.cpp
@@ -103,7 +103,8 @@ const Type *BytecodeParser::parseTypeConstant(const uchar *&Buf,
//
void BytecodeParser::refineAbstractType(const DerivedType *OldType,
const Type *NewType) {
- if (OldType == NewType) return; // Type is modified, but same
+ if (OldType == NewType &&
+ OldType->isAbstract()) return; // Type is modified, but same
TypeValuesListTy::iterator I = find(MethodTypeValues.begin(),
MethodTypeValues.end(), OldType);
@@ -113,7 +114,12 @@ void BytecodeParser::refineAbstractType(const DerivedType *OldType,
"Can't refine a type I don't know about!");
}
- *I = NewType; // Update to point to new, more refined type.
+ if (OldType == NewType) {
+ assert(!OldType->isAbstract());
+ I->removeUserFromConcrete();
+ } else {
+ *I = NewType; // Update to point to new, more refined type.
+ }
}