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

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: Missing call to ExpEmit::Free in FxAssign::Emit?

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

by Rachael » Mon Feb 17, 2025 7:17 pm

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.

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

by phantombeta » Mon Feb 17, 2025 3:45 pm

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.

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

by phantombeta » Mon Feb 17, 2025 2:52 am

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.

Top