aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader/ConstantReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Bytecode/Reader/ConstantReader.cpp')
-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.
+ }
}