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)
if ( !delay && res.isValid() && res.isInstance ) {
AbstractType::Ptr type = res.type.abstractType();
if ( m_lastTypeWasAuto )
{
// remove references or aliases
type = TypeUtils::realType( type, topContext() );
// Turn "5" into "int"
type = TypeUtils::removeConstants( type, topContext() );
// ensure proper const modifier is set
type->setModifiers( integral->modifiers() );
if (ReferenceType::Ptr ref = lastType().cast<ReferenceType>()) {
ref->setBaseType( type );
type = ref.cast<AbstractType>();
if (type) {
if ( m_lastTypeWasAuto ) {
// remove references or aliases
type = TypeUtils::realType( type, topContext() );
// Turn "5" into "int"
type = TypeUtils::removeConstants( type, topContext() );
// ensure proper const modifier is set
type->setModifiers( integral->modifiers() );
if (ReferenceType::Ptr ref = lastType().cast<ReferenceType>()) {
ref->setBaseType( type );
type = ref.cast<AbstractType>();
}
}
}
openType( type );
openedType = true;
openType( type );
openedType = true;
}
}
}
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