Page 1 of 1

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

Posted: Mon Feb 17, 2025 2:52 am
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.

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

Posted: Mon Feb 17, 2025 3:45 pm
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.

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

Posted: Mon Feb 17, 2025 7:17 pm
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.