Skip to content

Try to fix crash in loongarch64 compiler

Pierre Muller requested to merge PierreMuller/FPCSource:fix-loongarch64 into main

loongarch64 compiler has a specific routine, called fixupref that generates some instructions that are stored into a tasmlist given as an input parameter. This function returns a boolean, if the return value is false, the populated list gets sometimes discarded. This can lead to a later crash, because the unused and freed instructions might have been stored in live and live_end fields of the reginfo record used inside rgobj unit.

The fix checks if any of the to be discarded instructions has been stored inside reginfo records, and resets the field in that case.

The fix might need to be more general, because other parts of the compiler, like all optimization code, also remove instructions...

Merge request reports