The MASM Forum

64 bit assembler => UASM Assembler Development => Topic started by: _japheth on May 31, 2024, 05:49:01 PM

Title: Potential error in JWasm offsprings
Post by: _japheth on May 31, 2024, 05:49:01 PM

This code may cause problems when assembled:

;--- 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

It may also concern uasm and asmc...
Title: Re: Potential error in JWasm offsprings
Post by: Biterider on May 31, 2024, 06:32:16 PM
Hi Japheth
Thanks for the report.
I was also able to confirm the same behaviour with UASM.
The assembly process went into an infinite loop and I had to shut it down.

Biterider

Title: Re: Potential error in JWasm offsprings
Post by: HSE on June 17, 2024, 12:25:52 AM
Hi _japhet!

Quote from: _japheth on May 31, 2024, 05:49:01 PMIt may also concern uasm and asmc...

Your correction work perfectly in UASM  :thumbsup:

Thanks, HSE
Title: Re: Potential error in JWasm offsprings
Post by: johnsa on August 08, 2024, 06:56:02 AM
What correction has been suggested to fix this issue?

I've tested this on the new in-development 2.57 version. I can confirm that if dds is declared everything works perfectly with and without listing. However, leave dds undefined and I can reproduce the infinite loop (the paralist for the proc blows up).
Title: Re: Potential error in JWasm offsprings
Post by: HSE on August 08, 2024, 09:41:36 PM
Hi Johnsa,

Quote from: johnsa on August 08, 2024, 06:56:02 AMWhat correction has been suggested to fix this issue?

fixed problem if name... (https://github.com/Baron-von-Riedesel/JWasm/commit/8506d9327aac98048f5f6943cb451bb54f894567)

HSE