Code generation crash with ZetaBot 0.3.0

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!

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is ON
[img] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Code generation crash with ZetaBot 0.3.0

Re: Code generation crash with ZetaBot 0.3.0

by _mental_ » Mon May 13, 2019 3:55 am

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.

Re: Code generation crash with ZetaBot 0.3.0

by Gustavo6046 » Thu May 09, 2019 5: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.

Re: Code generation crash with ZetaBot 0.3.0

by phantombeta » Thu May 09, 2019 4: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.

Re: Code generation crash with ZetaBot 0.3.0

by Gustavo6046 » Thu May 09, 2019 4: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.

Code generation crash with ZetaBot 0.3.0

by JPL » Thu Mar 07, 2019 10:46 am

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.

Top