Kaydet (Commit) 60a64d18 authored tarafından David Ostrovsky's avatar David Ostrovsky Kaydeden (comit) Andras Timar

climaker: Fix handling incomplete types

The order in which the hash table of incomplete structure types is
iterated is non-deterministic. Make sure that the array fields are
complete types before they are assigned.

This fixed weird error on Windows 64 bit. The reason this bug wasn't
hitting on 32 bit Windows build is because the generation order was
different and by chance the referenced fields were already generated.

Change-Id: Ifc8622b420fc25fea5a0ac8c09d08f7804c9b77c
Reviewed-on: https://gerrit.libreoffice.org/13851Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Reviewed-by: 's avatarAndras Timar <andras.timar@collabora.com>
Tested-by: 's avatarAndras Timar <andras.timar@collabora.com>
üst 6143a7ee
......@@ -1268,8 +1268,19 @@ Assembly ^ TypeEmitter::type_resolve(
}
else
{
field_type =
get_type( pseq_members[ member_pos ] );
field_type = get_type( pseq_members[ member_pos ] );
if (field_type->IsArray
&& m_incomplete_structs[cts_name]
&& !field_type->Namespace->Equals("System"))
{
//Find the value type. In case of sequence<sequence< ... > > find the actual value type
::System::Type ^ value = field_type;
while ((value = value->GetElementType())->IsArray);
//If the value type is a struct then make sure it is fully created.
get_complete_struct(value->FullName);
field_type = get_type(pseq_members[member_pos]);
}
}
members[ member_pos ] =
entry->m_type_builder->DefineField(
......@@ -1340,12 +1351,6 @@ Assembly ^ TypeEmitter::type_resolve(
}
else if (field_type->IsArray)
{
//Find the value type. In case of sequence<sequence< ... > > find the actual value type
::System::Type ^ value = field_type;
while ((value = value->GetElementType())->IsArray);
//If the value type is a struct then make sure it is fully created.
get_complete_struct(value->FullName);
code->Emit( Emit::OpCodes::Ldarg_0 );
code->Emit( Emit::OpCodes::Ldc_I4_0 );
code->Emit(
......
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