Nested procedure and functions docs are wrong
Original Reporter info from Mantis: FPCCore
-
Reporter name: FPC core team
Original Reporter info from Mantis: FPCCore
- Reporter name: FPC core team
Description:
Section 6.4.of the Programmer's Manual states:
When a routine is declared within the scope of a procedure or function, it is said to be nested. In this case, an additional invisible parameter is passed to the nested routine. This additional parameter is the frame pointer address of the calling routine. This permits the nested routine to access the local variables and parameters of the calling routine.
This is nonsense. The extra parameter needed is the static link pointer, that points to the frame of the parent procedure (not the calling procedure). This is the very reason why it is needed at all and why it is called the static link pointer, as opposed to the dynamic link or frame pointer that points to the frame of the calling procedure (which is not needed when the stack frame has a fixed size).
Additional information:
Reporter: Adriaan van Os
EMail: fpc at microbizz dot nl
Mantis conversion info:
- Mantis ID: 5698
- OS: Mac OS X
- Version: 1.9.8
- Fixed in version: 1.9.9