Wrong register values in assembly methods due to implicit exceptions
Original Reporter info from Mantis: luizamerico
-
Reporter name: Luiz Americo
Original Reporter info from Mantis: luizamerico
- Reporter name: Luiz Americo
Description:
When writing an assembly method/procedure with reference counted types like open arrays, fpc introduce implicit exceptions that modify register values like EDX and EAX.
Follows an example and the generated assembler file. Notice that the parameter Count should be located in EDX but we get a zero value. In fact when entering the function EDX is equal to count and EAX is equal to self but as soon the exception handling code is executed both EAX and EDX are set to zero.
Using {$IMPLICITEXCEPTIONS OFF} will give the correct result (similar to Delphi although in the later count parameter is stored in ECX instead of EDX - bug 15691)
Tested in 2.7.1 [2011/08/05] for i386 win32
Mantis conversion info:
- Mantis ID: 20075
- Version: 2.7.1
- Fixed in version: 3.0.0
- Fixed in revision: 19341 (#c6a0cafd)