http://edthebat.com/doom/classnamebugtest.pk3
See example.
If a class is defined by a function which returns a name, attempting to retrieve the name of said class either via explicit casting or GetClassName() will result in a Very Fatal Error.
Issue is present as recent as Devbuild 3.7pre-746-ge83af1590 (Dec 6, 2018)
Returned Name as Class leads to Very Fatal Error
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Re: Returned Name as Class leads to Very Fatal Error
It's some sort of non-tirivial problem with JIT. The sample works correctly without it.
Spoiler: Source code
Spoiler: AssemblyIn the assembly above the place marked with crash! contains bogus (truncated?) value in RDX.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Returned Name as Class leads to Very Fatal Error
So, another Asmjit bug?
Re: Returned Name as Class leads to Very Fatal Error
Yes. Although this is one of the first we encountered and is easily avoided by emitting slightly different code.
When using 64-bit constants in certain situations asmjit emits the wrong opcode, or mysteriously replaces the top 32 bits with 0xffffffff. The disassembly _mental_ pasted looks perfectly right, but what it actually emitted was the equivalent of "mov qword [rax], 0xffffffff69906048 ; mov qword [tmpPtr0], 105553169906048".
When using 64-bit constants in certain situations asmjit emits the wrong opcode, or mysteriously replaces the top 32 bits with 0xffffffff. The disassembly _mental_ pasted looks perfectly right, but what it actually emitted was the equivalent of "mov qword [rax], 0xffffffff69906048 ; mov qword [tmpPtr0], 105553169906048".