Allow deserialization of IrVariable without initializer.

This commit is contained in:
Alexander Gorshenev
2017-06-16 14:23:45 +03:00
committed by alexander-gorshenev
parent cdf4147c4d
commit a1ee247a7b
@@ -1087,7 +1087,10 @@ internal class IrDeserializer(val context: Context,
fun deserializeIrVariable(proto: KonanIr.IrVar, descriptor: VariableDescriptor,
start: Int, end: Int, origin: IrDeclarationOrigin): IrVariable {
val initializer = deserializeExpression(proto.getInitializer())
val initializer = if (proto.hasInitializer()) {
deserializeExpression(proto.getInitializer())
} else null
val variable = IrVariableImpl(start, end, origin, descriptor, initializer)
return variable