[Patch / Refector] Peephole instruction removal function
Original Reporter info from Mantis: CuriousKit @CuriousKit
-
Reporter name: J. Gareth Moreton
Original Reporter info from Mantis: CuriousKit @CuriousKit
- Reporter name: J. Gareth Moreton
Description:
This patch aims to reduce maintenance costs and the risk of forgetting to remove an instruction from the linked list prior to freeing it (leaving a dangling pointer). Most references to "asml.remove(hp1); hp1.free;" and similar pairs of statements have been replaced with a new "RemoveInstruction" routine that calls these two methods for the given tai object.
Also, where the current instruction (p) is freed nearby, RemoveCurrentP is called where possible.
Steps to reproduce:
Apply patch and confirm correct compilation on all relevant platforms.
Additional information:
Should an additional step be required to remove instructions in future, the RemoveInstruction routine can be updated to safely include this functionality.
Regression tests have been run successfully for i386-win32 and x86_64-win64 and "make fullcycle" cross compilation from these platforms.
Mantis conversion info:
- Mantis ID: 37399
- OS: Microsoft Windows
- OS Build: 10 Professional
- Build: r45814
- Platform: Cross-platform
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 46862 (#2c544778)