Calling methods on a temporary string uses previous string

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is ON
[img] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Calling methods on a temporary string uses previous string

Re: Calling methods on a temporary string uses previous string

by m8f » Mon Sep 22, 2025 7:28 pm

Yes, it reproduces with both on and off:

Code: Select all

---------
I'M OLD
i'm old
]vm_jit
"vm_jit" is "false" (default: "true")

Code: Select all

---------
I'M OLD
i'm old
]vm_jit
"vm_jit" is "true" (default: "true")

Re: Calling methods on a temporary string uses previous string

by Jay0 » Mon Sep 22, 2025 5:54 pm

does it reproduce with the JIT off?

Re: Calling methods on a temporary string uses previous string

by phantombeta » Wed Sep 17, 2025 10:43 am

This sounds like it's somehow getting the wrong register for the function call...
AFAIK string literals (i.e., constants) have to be copied over from a string constant to a string register to have a function called on them, something must be going wrong in that process...

Calling methods on a temporary string uses previous string

by m8f » Tue Sep 16, 2025 8:52 pm

Steps to reproduce:
Load this code as zscript.zs lump and start any Doom map with a zombie:

Code: Select all

version 4.14

class TestZombie : Zombieman replaces Zombieman
{
  override void BeginPlay()
  {
    //Console.Printf("I'll cause a VM abort".makeLower());

    Console.Printf("---------");
    Console.Printf("I'M OLD");
    Console.Printf("I'm new".makeLower());
  }
}
Code loads without errors and warnings (with `developer 2`).

Expected result:

Code: Select all

---------
I'M OLD                                                                                                             
i'm new
OR a syntax error on loading?

Actual result:

Code: Select all

---------
I'M OLD                                                                                                             
i'm old
Note: the first Console.Printf, if uncommented, causes a VM abort: `VM execution aborted: tried to read from address zero. In function parameter "self"`

Reproduces on GZDoom 4.14 and the latest master (commit f892a750b "Silence integer division warning").
Reproduces on Manjaro Linux, Linux 6.6.103-3-MANJARO on x86_64, and Debian GNU/Linux 13 (trixie), Linux 6.12.34+rpt-rpi-v8 on aarch64.

Top