Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Struct vs local name conflict #204

Open
john-terraspace opened this issue Aug 4, 2024 · 2 comments
Open

Struct vs local name conflict #204

john-terraspace opened this issue Aug 4, 2024 · 2 comments
Labels
Milestone

Comments

@john-terraspace
Copy link
Member

;--- v2.18: problem if the name of struct member matches the name
;--- of a stack variable ( or a procedure ):
;--- if the structured variable isn't defined, the stack variable
;--- becomes "unknown". Worse, if a listing is to be produced, an
;--- infinite loop may be entered.

.386
.MODEL flat
option casemap:none

DDS struct
dwSize dd ?
dwOfs dd ?
DDS ends

.data

;dds DDS <0,0> ;<--- problem: the variable isn't defined

.code

P1 proc

local dwFirst:dword
local dwSize:dword
local dwThird:dword

mov dwSize, 0
mov dds.dwSize, 0
mov dwSize, 1
mov dds.dwSize, 1
ret

P1 endp

start:
call P1
ret

end start
@john-terraspace john-terraspace added this to the V2.57 milestone Aug 4, 2024
@john-terraspace
Copy link
Member Author

This works as long as dds is defined now in 2.57.
There is still a possible crash/error if dds isn't declared which I've not got an immediate solution for.

@john-terraspace
Copy link
Member Author

Tested with listing file generation too and it seems ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant