Code: Select all
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;
}
}