Is this a ml bug or am I missing something?

ml fails to assemble the following code, complaining about invalid data initializer:

.data?

CredHandle STRUCT
dwLower        dd ?
dwUpper        dd ?
CredHandle ENDS

test_struct STRUCT
_ctxthandle CredHandle <?>
_credhandle CredHandle <?>
test_struct ENDS

test_struct_decl test_struct <?>


but if the first member is not a structure then it assembles fine

CredHandle STRUCT
dwLower        dd ?
dwUpper        dd ?
CredHandle ENDS

test_struct STRUCT
dd ?
_ctxthandle CredHandle <?>
_credhandle CredHandle <?>
test_struct ENDS

test_struct_decl test_struct <?>
Posted on 2005-10-18 16:29:56 by arafel
I don't know what the answer to your question is, but you can use '<>' or '<{}>' with non initiated struct data if you want the code to be able to get parsed with no errors.

Regards.

Kecol.-

PS: I found that 'initialize' is something related to cruelty.
Posted on 2005-10-18 17:21:21 by Kecol
Arafel,


    tst STRUCT
      item1 dd ?
      item2 dd ?
    tst ENDS

    nxt STRUCT
      arg1 tst <>
      arg2 tst <>
    nxt ENDS


Empty brackets mean the structure is not initialised.
Posted on 2005-10-18 21:26:41 by hutch--
well.. i know what empty brackets mean. i merely was wondering why initializing with <?> fails in the above situation.
Posted on 2005-10-18 21:37:49 by arafel

CredHandle STRUCT
dwLower        dd ?
dwUpper        dd ?
CredHandle ENDS

test_struct STRUCT
_ctxthandle CredHandle <?,?>
_credhandle CredHandle <?,?>
test_struct ENDS

test_struct_decl test_struct <<?,?>,<?,?>>

this is the correct initialization
with only ? you are not initializing the nested struc

CredHandle STRUCT
dwLower        dd ?
dwUpper        dd ?
CredHandle ENDS

test_struct STRUCT
blah dd ?
_ctxthandle CredHandle <?,?>
_credhandle CredHandle <?,?>
test_struct ENDS

test_struct_decl test_struct <?,<?,?>,<?,?>>

this is the correct initialization

so, if you write in this case only <?> the ",<?,?>,<?,?>" part is assumed uninitialized and it works

examples:
.data?
test_struct_decl2 test_struct <,<?,?>,>
test_struct_decl3 test_struct <?,>
test_struct_decl4 test_struct <,<,?>,>
test_struct_decl5 test_struct <,<,>,<,>>
.data
test_struct_decl6 test_struct <7,,<,7>>
Posted on 2005-10-19 11:14:31 by drizz
ah ok, i see.
thanks drizz.
Posted on 2005-10-20 06:06:50 by arafel