ZScript Multiple return values crash

Sat Mar 13, 2021 8:17 am

summon crasher twice to cause crash in GZDoom.

Code:
class Dummy
{
   String text;

   static Dummy Create(String s)
   {
      let t = new('Dummy');
      t.text = s;
      return t;
   }
}

class Crasher : Actor
{
   // This one is fine
   static Dummy, Dummy MakePair()
   {
      return Dummy.Create("First"), Dummy.Create("Second");
   }

   // Something goes horribly wrong when this is used
   static Dummy, Dummy ReturnMagic()
   {
      return MakePair();
   }

   Dummy a, b;
   
   States
   {
      Spawn:
         TNT1 A 0 nodelay {
            [a, b] = ReturnMagic();

            Console.Printf("A: %p, B: %p", a, b);
         }
         TNT1 A 0 {
            // Crashes only when split into another function
            Console.Printf("%s", b ? b.text : "(B is empty)");
         }
         stop;
   }
}

It once crashed durring startup, but I can't reproduce that. Might be unrelated.