Commit ce1dde3b authored by Milian Wolff's avatar Milian Wolff

Verify validity of type after deserialization from the storage.

BUG: 318972
parent ca18aeb4
...@@ -459,22 +459,23 @@ void TypeBuilder::createIntegralTypeForExpression(ExpressionAST* expression) ...@@ -459,22 +459,23 @@ void TypeBuilder::createIntegralTypeForExpression(ExpressionAST* expression)
if ( !delay && res.isValid() && res.isInstance ) { if ( !delay && res.isValid() && res.isInstance ) {
AbstractType::Ptr type = res.type.abstractType(); AbstractType::Ptr type = res.type.abstractType();
if ( m_lastTypeWasAuto ) if (type) {
{ if ( m_lastTypeWasAuto ) {
// remove references or aliases // remove references or aliases
type = TypeUtils::realType( type, topContext() ); type = TypeUtils::realType( type, topContext() );
// Turn "5" into "int" // Turn "5" into "int"
type = TypeUtils::removeConstants( type, topContext() ); type = TypeUtils::removeConstants( type, topContext() );
// ensure proper const modifier is set // ensure proper const modifier is set
type->setModifiers( integral->modifiers() ); type->setModifiers( integral->modifiers() );
if (ReferenceType::Ptr ref = lastType().cast<ReferenceType>()) { if (ReferenceType::Ptr ref = lastType().cast<ReferenceType>()) {
ref->setBaseType( type ); ref->setBaseType( type );
type = ref.cast<AbstractType>(); type = ref.cast<AbstractType>();
}
} }
}
openType( type ); openType( type );
openedType = true; openedType = true;
}
} }
} }
if( delay || !openedType ) { if( delay || !openedType ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment