www.digitalmars.com         C & C++   DMDScript  

D - module init problem

Can someone please tell me what this is, and why it's crashing?

It always crashes at 0040B182 when I add too much inline asm it seems.  The
asm in question doesn't even have to be executed for it to happen.  I've
tried saving and restoring all registers too.

DMD also doesn't always seem to generate moduleinfo's for modules;
especially this seems so for modules with templates in them.  Same for
assert handlers.  Maybe this is related?

Sean

_Dmoduleinit__moduleCtor2_FAC10ModuleInfoiZv:

0040B118 push eax

0040B119 push ebx

0040B11A push ebp

0040B11B mov ebp,eax

0040B11D push esi

0040B11E push edi

0040B11F xor edi,edi

0040B121 cmp dword ptr [esp+18h],edi

0040B125 je _Dmoduleinit__moduleCtor2_FAC10ModuleInfoiZv+0D1h (40B1E9h)

0040B12B mov edx,dword ptr [esp+1Ch]

0040B12F mov ebx,dword ptr [esp+18h]

0040B133 mov dword ptr [esp+10h],edx

0040B137 mov ebx,dword ptr [esp+10h]

0040B13B mov esi,dword ptr [ebx+edi*4]

0040B13E test dword ptr [esi+20h],2

0040B145 jne _Dmoduleinit__moduleCtor2_FAC10ModuleInfoiZv+0C6h (40B1DEh)

0040B14B cmp dword ptr [esi+24h],0

0040B14F jne _Dmoduleinit__moduleCtor2_FAC10ModuleInfoiZv+3Fh (40B157h)

0040B151 cmp dword ptr [esi+28h],0

0040B155 je _Dmoduleinit__moduleCtor2_FAC10ModuleInfoiZv+0AFh (40B1C7h)

0040B157 test dword ptr [esi+20h],1

0040B15E je _Dmoduleinit__moduleCtor2_FAC10ModuleInfoiZv+65h (40B17Dh)

0040B160 test ebp,ebp

0040B162 jne _Dmoduleinit__moduleCtor2_FAC10ModuleInfoiZv+0C6h (40B1DEh)

0040B164 push esi

0040B165 push offset __Class_ModuleCtorError (418B28h)

0040B16A call __d_newclass (4080E8h)

0040B16F add esp,4

0040B172 call
_Dmoduleinit_ModuleCtorError__ctor_FC10ModuleInfoZC15ModuleCtorError
(40B0A4h)

0040B177 push eax

0040B178 call (409131h)

0040B17D push dword ptr [esi+14h]

0040B180 xor eax,eax

0040B182 or dword ptr [esi+20h],1

0040B189 push dword ptr [esi+10h]

0040B18C call _Dmoduleinit__moduleCtor2_FAC10ModuleInfoiZv (40B118h)

0040B191 mov ecx,dword ptr [esi+24h]

0040B194 test ecx,ecx

0040B196 je _Dmoduleinit__moduleCtor2_FAC10ModuleInfoiZv+82h (40B19Ah)

0040B198 call ecx

0040B19A and dword ptr [esi+20h],0FFFFFFFEh

0040B1A1 mov edx,2

0040B1A6 or dword ptr [esi+20h],edx

0040B1A9 mov ecx,dword ptr [_Dmoduleinit__moduleinfo_dtors_i_k (41B4D0h)]

0040B1AF inc ecx

0040B1B0 mov dword ptr [_Dmoduleinit__moduleinfo_dtors_i_k (41B4D0h)],ecx

0040B1B6 dec ecx

0040B1B7 mov edx,dword ptr [_Dmoduleinit__moduleinfo_dtors_AC10ModuleInfo+4
(41B4CCh)]

0040B1BD mov eax,dword ptr [_Dmoduleinit__moduleinfo_dtors_AC10ModuleInfo
(41B4C8h)]

0040B1C2 mov dword ptr [edx+ecx*4],esi

0040B1C5 jmp _Dmoduleinit__moduleCtor2_FAC10ModuleInfoiZv+0C6h (40B1DEh)

0040B1C7 push dword ptr [esi+14h]

0040B1CA mov eax,1

0040B1CF or dword ptr [esi+20h],2

0040B1D6 push dword ptr [esi+10h]

0040B1D9 call _Dmoduleinit__moduleCtor2_FAC10ModuleInfoiZv (40B118h)

0040B1DE inc edi

0040B1DF cmp edi,dword ptr [esp+18h]

0040B1E3 jb _Dmoduleinit__moduleCtor2_FAC10ModuleInfoiZv+23h (40B13Bh)

0040B1E9 pop edi

0040B1EA pop esi

0040B1EB pop ebp

0040B1EC pop ebx

0040B1ED pop eax

0040B1EE ret 8
Apr 07 2003