[Fixed] Constants can be passed to "out" arguments, causes crashes

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Constants can be passed to "out" arguments, causes crashes

Postby phantombeta » Mon Oct 21, 2019 7:55 am

You can pass constant values to "out" arguments. Once the function call happens, this causes a crash. (Both with the VM and the JIT)
Passing a constant to an out parameter should error out. Mostly putting this here so I don't forget it.

Example code:
Code: Select allExpand view
class BEPlayerBase : DoomPlayer
   private void CheckCursorMovement(out int maxWidth, int maxHeight)
      Console.Printf ("%d", maxWidth);

   vector2 SomeGridCoords;

   override void Tick()
      int buttons = player.original_cmd.buttons;
      int oldbuttons = player.original_oldbuttons;

      if (buttons & BT_ATTACK)
         CheckCursorMovement(5, 5);

User avatar
In the meadow of sinful thoughts, every flower's a perfect one
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

Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest