Code generation crash with ZetaBot 0.3.0

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!

Code generation crash with ZetaBot 0.3.0

Postby JPL » Thu Mar 07, 2019 11:46 am

From the ZetaBot dev thread, I tried running the latest release from the project's GitHub page and got this:

Code: Select allExpand view
gzdoom: gzdoom/src/scripting/backend/codegen.cpp:2319: virtual ExpEmit FxPostIncrDecr::Emit(VMFunctionBuilder*): Assertion `ValueType == Base->ValueType && IsNumeric()' failed.


I'm not the dev obviously, just remembered it existed and wanted to try it out.
User avatar
JPL
 
 
 
Joined: 09 Apr 2012

Re: Code generation crash with ZetaBot 0.3.0

Postby Gustavo6046 » Thu May 09, 2019 5:20 pm

This issue does not happen with the latest stable version of GZDoom. In the case of the ZetaBot, it was temporarily fixed in ZetaBot v0.4.0 merely by fiddling with the source code (it seemed to be related to certain patches of code (most likely from Standard.zsc), which were refactored, though I don't recall which - try reading diffs), but it returned in a later version (and still exists, as of v0.7.0) for an unknown reason.
User avatar
Gustavo6046
 
Joined: 13 May 2017
Location: In an urban area in Brazil.
Discord: Gustavo6046#9009

Re: Code generation crash with ZetaBot 0.3.0

Postby phantombeta » Thu May 09, 2019 5:56 pm

Gustavo6046 wrote:This issue does not happen with the latest stable version of GZDoom. In the case of the ZetaBot, it was temporarily fixed in ZetaBot v0.4.0 merely by fiddling with the source code (it seemed to be related to certain patches of code (most likely from Standard.zsc), which were refactored, though I don't recall which - try reading diffs), but it returned in a later version (and still exists, as of v0.7.0) for an unknown reason.

The latest stable version is a Release build. Assertions only happen in Debug builds.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: The United Soviet Socialist Dictatorship of Hueland
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Code generation crash with ZetaBot 0.3.0

Postby Gustavo6046 » Thu May 09, 2019 6:03 pm

Yet, there is probably an issue if the assertion is meant to denote something is wrong, yet whatever condition it tries to prohibit is silently ignored in Release builds. I'll try to build GZDoom as a Release build via CMake, and see if any significant issue appears. Thank you.
User avatar
Gustavo6046
 
Joined: 13 May 2017
Location: In an urban area in Brazil.
Discord: Gustavo6046#9009

Re: Code generation crash with ZetaBot 0.3.0

Postby _mental_ » Mon May 13, 2019 4:55 am

Here is the minimal sample. The problem is in type mismatch (signed vs. unsigned) for increment/decrement operators.
Code: Select allExpand view
class IncrDecrTypeMismatch
{
   void Test()
   {
      int a = 0;

      // These lines trigger assertion failures
      uint b = a++;
      uint c = --a;
      
      // These do not
      uint b; b = a++;
      uint c; c = --a;
   }
}

Curiously enough, typecasts are present for both local variable declarations and assignments in the sample above.
However, they are different in unsigned flag propagation, compare this cast (called from FxLocalVariableDeclaration::Resolve) with assignment.
_mental_
 
 
 
Joined: 07 Aug 2011


Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest