"Kill Monsters" command broken with my mod

Tue Dec 11, 2018 10:21 am

As the title says, I have an issue with the "kill" command and my mod (which I will send to the developers).

The only error message I am getting is:
Code:
Execution could not continue.

Ambiguous operand size: mov [r12+32], 0


Only 64-bit of GZDoom is affected while 32-bit works fine.

This build (gzdoom-x64-g3.7pre-302-g927d33306) and previous ones are working fine on both 64 and 32-bits
From this build onward (gzdoom-x64-g3.7pre-733-g101ebe173) it only works on 32-bit while 64-bit gives me the given error message. It doesn't matter if I try to kill specific monster types or just "monsters".

Re: "Kill Monsters" command broken with my mod

Wed Dec 12, 2018 4:05 am

Send the mod please.

Re: "Kill Monsters" command broken with my mod

Wed Dec 12, 2018 5:44 am

I thought I did, must have done something wrong the first time. This time it was sent correctly.

Re: "Kill Monsters" command broken with my mod

Wed Dec 12, 2018 7:21 am

Here is a minimal sample. It will trigger a failure of this assertion first, and then, summoning A will lead to this error on JIT code generation.

Code:
version "2.4"

struct S
{
    void Func()
    {
    }
}

class A : Actor
{
    override void BeginPlay()
    {
        S s;
        s.Func();
    }
}

EDIT: To workaround this engine bug in the mod, it should be enough to make ParticleSpawner.SpawnParticles() function static and avoid creation of ParticleSpawner instances (which is the right thing to do anyway).

Re: "Kill Monsters" command broken with my mod

Wed Dec 12, 2018 8:31 am

I actually compiled a debug build myself before reporting and saw the same assertion failure. Since it was during startup however I thought it was unrelated and that I compiled something wrongly...

Anyhow, I fixed it in my mod, thanks for the clarification. :)

Re: "Kill Monsters" command broken with my mod

Wed Dec 12, 2018 8:46 am

Is this caused by the zero-length struct?

Re: "Kill Monsters" command broken with my mod

Wed Dec 12, 2018 9:17 am

Yes, because of RegType in VMFunctionBuilder::FramePointer is REGT_NIL to be precise.