Integer constant does not have type integer

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!

Integer constant does not have type integer

Postby MartinHowe » Sat Feb 27, 2021 3:58 pm

I was trying to track down a crash in the black cats mod and created a debug build of GZDoom.
Although this is in fact unrelated, it seems that somehow, integer constants are not strictly regarded as integers.
Steps to reproduce:

1 Build a debug build of the current GZDoom master downloaded straight from the repository.
2. Load a directory or PK3 containing this script:
Code: Select allExpand view
class bug : actor
{
    const e = 8;

    protected int i;

    void X_Bug()
    {
        int ee = e;

        i = max(1, ee);
    }
}
3. Start GZDoom and use -file to load it.
4. This one compiles with no issues.
5. Now instead use this script:
Code: Select allExpand view
class bug : actor
{
    const e = 8;

    protected int i;

    void X_Bug()
    {
        i = max(1, e);
    }
}
6. Expected result: game starts
7. Actual result (full log below):
Code: Select allExpand view
LoadActors: Load actor definitions.
gzdoom: /home/martin/Games/Engines/GZDoom/gzdoom/src/common/scripting/backend/codegen.cpp:5264: virtual FxExpression* FxMinMax::Resolve(FCompileContext&): Assertion `value.Type == ValueType' failed.
Aborted (core dumped)

Full log:
Code: Select allExpand view
martin@freddie:~/Games/Engines/GZDoom/gzdoom-master$ ./gzdoom -iwad doom -file z
GZDoom g4.6pre-130-gfeb3520ee - 2021-02-26 10:37:55 +0100 - SDL version
Compiled on Feb 27 2021

OS: Linux Mint 20, Linux 5.4.0-66-generic on x86_64
M_LoadDefaults: Load system defaults.
W_Init: Init WADfiles.
 adding /home/martin/Games/Engines/GZDoom/gzdoom-master/gzdoom.pk3, 632 lumps
 adding /home/martin/Games/Engines/GZDoom/gzdoom-master/game_support.pk3, 2514 lumps
 adding /usr/share/doom/doom.wad, 2306 lumps
 adding /home/martin/Games/Engines/GZDoom/gzdoom-master/game_widescreen_gfx.pk3, 39 lumps
 adding z, 1 lumps
I_Init: Setting up machine state.
CPU Vendor ID: GenuineIntel
  Name: Intel(R) Xeon(R) CPU E5345 @ 2.33GHz
  Family 6, Model 15, Stepping 11
  Features: SSE2 SSE3 SSSE3 HyperThreading
V_Init: allocate screen.
S_Init: Setting up sound.
I_InitSound: Initializing OpenAL
  Opened device EMU20k1 [Sound Blaster X-Fi Series] Analogue Stereo
  EFX enabled
ST_Init: Init startup screen.
Checking cmd-line parameters...
S_InitData: Load sound definitions.
G_ParseMapInfo: Load map definitions.
Texman.Init: Init texture manager.
ParseTeamInfo: Load team definitions.
LoadActors: Load actor definitions.
gzdoom: /home/martin/Games/Engines/GZDoom/gzdoom/src/common/scripting/backend/codegen.cpp:5264: virtual FxExpression* FxMinMax::Resolve(FCompileContext&): Assertion `value.Type == ValueType' failed.
Aborted (core dumped)=======================================================================================================.......]
martin@freddie:~/Games/Engines/GZDoom/gzdoom-master$


If this is getting through in non-debug builds, who knows what trouble it might be subtly causing :shrug:
User avatar
MartinHowe
In space, no-one can hear you KILL an ALIEN
 
Joined: 11 Aug 2003
Location: Waveney, United Kingdom

Re: Integer constant does not have type integer

Postby Graf Zahl » Sat Feb 27, 2021 5:10 pm

Looks like a bogus assert. The expression is constant and the compiler tries to optimize it out, but something with the type does not seem to do what the assert expects.
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 0 guests