Consider following code:
;mov rax, [var] ;produces error as expected
lea rbx, [delta]
mov rax, [rbx + (var - delta)] ;no error or warning
var dd 0
In my project, I often have to access data like this, via "delta offset" stored in register. Unfortunatelly, it seems there is no type size checking in this kind of addressing. This makes it very easy to accidentally access incorrect size in memory, like in example (var shold have been read to eax, not rax). This is especially problematic when accessing Windows structures, where you often aren't sure which member is dword and which is qword.
Would it be possible to issue some warning in this case? At least for case, when "var" has associated size, and "delta" does not.
Log in to post a comment.