Missing call to ExpEmit::Free in FxAssign::Emit?
Posted: 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:
I believe this will leak the register used for the result. As far as I can tell, the correct code should be this:
I found this issue while debugging a more serious one, which I'll be making a report and bugfix PR for soon.
Relevant code:
Code: Select all
if (intconst)
{ //fix int constant return for assignment
return Right->Emit(build);
}
Code: Select all
if (intconst)
{ //fix int constant return for assignment
result.Free (build);
return Right->Emit(build);
}