ZScript Compiler Crash

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

ZScript Compiler Crash

Post by Major Cooke »

Code: Select all

if ((GetPlayerInput(MODINPUT_BUTTONS & BT_ALTATTACK) &&
	!(GetPlayerInput(MODINPUT_OLDBUTTONS & BT_ALTATTACK))
It appears code like this is not caught (where MODINPUT_(OLD)BUTTONS is missing a ')' right after it) and causes a crash instead of printing an error.

Although, in fairness, I don't expect much being doable for this situation, aside from parenthesis count being off...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript Compiler Crash

Post by Graf Zahl »

With an empty body for the 'if' it works, but if some real code is inserted it crashes. It seems the grammar-generated parser loses it and starts to choke. Not much I can do here, aside from aborting the parser upon the first grammar-related syntax error.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: ZScript Compiler Crash

Post by _mental_ »

I guess this was fixed because by copy-pasting these line into various places I didn't manage to crash the parser.
Every time it gave me 'Unexpected ...' error for statement right after inserted code.
Post Reply

Return to “Closed Bugs [GZDoom]”