Passing variables to "out" Vector2/3 parameters doesn't work

These bugs do plan to be resolved, when they can be.

Moderator: GZDoom Developers

Passing variables to "out" Vector2/3 parameters doesn't work

Postby phantombeta » Fri Nov 15, 2019 11:26 am

As it says in the thread title, you can't pass variables as to Vector2/3 out parameters. Turns out there's some other issue my fix doesn't deal with. Heap-allocated values (e.g., member variables) can be passed just fine, while stack-allocated values (e.g., local variables) just crash GZDoom.
There seems to be two issues - First, it seems like it may still be calculating the wrong amount of parameters in the function call code. Second, there must be some issue where it doesn't correctly calculate or pass the vector's memory address.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
Global Moderator
 
Joined: 02 May 2013
Location: Brazil, South America, Earth, Orion-Cygnus Arm, Milky Way
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Passing variables to "out" Vector2/3 parameters doesn't

Postby phantombeta » Mon Jan 27, 2020 9:01 am

Turns out the reason for this is that, when it's a FxLocalVariable, it still emits shit as if it were a vector instead of a pointer. FxStructMember (used for struct and class members) works, though, so I'm not sure what the hell's up with this.
I have no idea how to deal with this crap.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
Global Moderator
 
Joined: 02 May 2013
Location: Brazil, South America, Earth, Orion-Cygnus Arm, Milky Way
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Passing variables to "out" Vector2/3 parameters doesn't

Postby Major Cooke » Mon Jan 27, 2020 9:31 am

Well, if it works for structs being treated as pointers, would it be possible to export DVector2/3 to ZScript somehow? That would allow for treating it like a pointer then, though that might ax any possibility of adding dynamic array support for it.
User avatar
Major Cooke
d = klabs(wall[wall[wall[sector[dasect].wallptr].point2].point2].x-s->x)...
Global Moderator
 
Joined: 28 Jan 2007


Return to On Hold Bugs

Who is online

Users browsing this forum: No registered users and 1 guest