Returned Name as Class leads to Very Fatal Error

Bugs that have been investigated and resolved somehow.

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

Returned Name as Class leads to Very Fatal Error

Post by Guest »

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

Re: Returned Name as Class leads to Very Fatal Error

Post by _mental_ »

It's some sort of non-tirivial problem with JIT. The sample works correctly without it.
Spoiler: Source code
Spoiler: Assembly
In the assembly above the place marked with crash! contains bogus (truncated?) value in RDX.
dpJudas
 
 
Posts: 3037
Joined: Sat May 28, 2016 1:01 pm

Re: Returned Name as Class leads to Very Fatal Error

Post by dpJudas »

Fixed in f0ce453.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
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

Post by Graf Zahl »

So, another Asmjit bug?
dpJudas
 
 
Posts: 3037
Joined: Sat May 28, 2016 1:01 pm

Re: Returned Name as Class leads to Very Fatal Error

Post by dpJudas »

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

Return to “Closed Bugs [GZDoom]”