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!
User avatar
JPL
 
 
Posts: 523
Joined: Mon Apr 09, 2012 12:27 pm
Contact:

Code generation crash with ZetaBot 0.3.0

Post by JPL »

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

Code: Select all

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
Gustavo6046
Posts: 136
Joined: Sat May 13, 2017 3:11 pm
Location: Brazil
Contact:

Re: Code generation crash with ZetaBot 0.3.0

Post by Gustavo6046 »

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
phantombeta
Posts: 2084
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Code generation crash with ZetaBot 0.3.0

Post by phantombeta »

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
Gustavo6046
Posts: 136
Joined: Sat May 13, 2017 3:11 pm
Location: Brazil
Contact:

Re: Code generation crash with ZetaBot 0.3.0

Post by Gustavo6046 »

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.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Code generation crash with ZetaBot 0.3.0

Post by _mental_ »

Here is the minimal sample. The problem is in type mismatch (signed vs. unsigned) for increment/decrement operators.

Code: Select all

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.
Post Reply

Return to “Bugs [GZDoom]”