Missing call to ExpEmit::Free in FxAssign::Emit?

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

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!
User avatar
phantombeta
Posts: 2147
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Missing call to ExpEmit::Free in FxAssign::Emit?

Post by phantombeta »

If the right side of an assignment is an int constant, it seems it outputs the constant expression directly. But when it does that, it never does anything to the original "result" register.
Relevant code:

Code: Select all

		if (intconst)
		{	//fix int constant return for assignment
			return Right->Emit(build);
		}
I believe this will leak the register used for the result. As far as I can tell, the correct code should be this:

Code: Select all

		if (intconst)
		{	//fix int constant return for assignment
			result.Free (build);
			return Right->Emit(build);
		}
I found this issue while debugging a more serious one, which I'll be making a report and bugfix PR for soon.
User avatar
phantombeta
Posts: 2147
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Missing call to ExpEmit::Free in FxAssign::Emit?

Post by phantombeta »

Was this report closed by mistake? :?:
My other report with a PR had its PR merged, but remains open, while this report was closed without a fix, nor an explanation why it was closed.
User avatar
Rachael
Posts: 13884
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Missing call to ExpEmit::Free in FxAssign::Emit?

Post by Rachael »

Yes that was my mistake. I thought both were related to the same issue and someone else already merged your PR so I thought both were fixed.

Return to “Bugs [GZDoom]”