News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

UASM crash with malformed .for syntax

Started by Biterider, May 06, 2020, 09:52:46 PM

Previous topic - Next topic

Biterider

Hi
I was adopting the .for form of looping and I accidentally wrote a "," in place of ":".
It seems that UASM didn't like it at all and crashed.


.for (ebx = 0 : ebx < 10, ebx++)
  ...
.endfor


Biterider

habran

You are correct, there was not implemented checking for that.
It will be fixed in next release.
Here is solution for that:
hll.c, inserted on line 1642 and it goes to line 1656 inclusive:

    /* check for 2 ':',if not throw an error */
    p = tokenarray[i].tokpos;
    for (b = 0; *p ;p++)
    {
       if (*p == ':') b++;
       if (*p == 39) break;
    }
    if (b < 2) {
      DebugMsg(("HllStartDir .for loop \n"));
    return(EmitError(SYNTAX_ERROR_EX, "Missing ':' before ')'"));
    }
    else if (b > 2) {
      DebugMsg(("HllStartDir .for loop \n"));
      return(EmitError(SYNTAX_ERROR_EX, "Only 2 ':' allowed before ')'"));
    }

line 1657:    // copy string to the buffer and get read of spaces

So, if you are in hurry, you know what to do :wink2:
Cod-Father

Biterider

Hi habran
Thanks for your replay. I only wanted to report this issue.
The best fix is to write it correctly  :biggrin:

Biterider