Semicolon after if skips error checking.

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

Semicolon after if skips error checking.

Postby Accensus » Tue Jun 15, 2021 8:09 am

Take the following code for example. "lol" is not an identifier and would normally error out on launch. However, if you put a semicolon right after the if statement, no error will show up and the game will launch. Tested on 4.6.0.
Code: Select allExpand view
class TestActor : Actor
{
   override void PostBeginPlay()
   {
      if (lol);
      {
         Console.Printf("Lorem ipsum.");
      }
      Super.PostBeginPlay();
   }
}
User avatar
Accensus
Vector, locked in.
 
Joined: 11 Feb 2016
Location: Somalia
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Semicolon after if skips error checking.

Postby Graf Zahl » Tue Jun 15, 2021 8:29 am

Looks like the empty 'if' gets deleted before its condition is checked...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest