OPATTR ignores invalid structure members
Brought to you by:
japheth
The OPATTR operator ignores invalid structure members:
;----------
FOO struct
m1 DWORD ?
m2 DWORD ?
FOO ends
.data
s FOO <>
%echo @CatStr(%opattr s.foo) ; <= should be zero
%echo @CatStr(%opattr FOO.foo) ; OK
%echo @CatStr(%opattr [eax].FOO.foo) ; <= should be zero
;----------
regards, qWord
jwasm v2.11 emits:
0
0
2
Hence I don't understand your first "should be zero" comment - obviously it IS zero. Did you use some peculiar cmdline options?
for the command line "jwasm.exe /c foo.asm", version "v2.11, Oct 20 2013" and "v2.12pre, Nov 4 2013" return:
768
0
2
MASM (all versions) reutrns zero in all three cases.
file foo.asm:
;--------
.686
.model flat, stdcall
option casemap:none
FOO struct
m1 DWORD ?
m2 DWORD ?
FOO ends
.data
s FOO <>
%echo @CatStr(%opattr s.foo)
%echo @CatStr(%opattr FOO.foo)
%echo @CatStr(%opattr [eax].FOO.foo)
.code
main proc
ret
main endp
end main
;---------
See also: http://masm32.com/board/index.php?topic=2597.msg27500#msg27500
regards, qWord
Ah yes. I added a simple ".model flat" statement, without a default language, to your sample code, and then OPATTR does indeed return 0 in the first "echo" line.
I guess this will be fixed in the next version.