Skip to content

uPSRuntime: implement ResultAsRegister outside the empty_methods_handler block - #320

Closed
Vizit0r wants to merge 1 commit into
remobjects:masterfrom
Vizit0r:fix/resultasregister-empty-handler
Closed

Vizit0r wants to merge 1 commit into
remobjects:masterfrom
Vizit0r:fix/resultasregister-empty-handler

Conversation

@Vizit0r

@Vizit0r Vizit0r commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Problem

c4657ad declared ResultAsRegister in the interface section of uPSRuntime, but its implementation stayed inside the {$else} branch of {$ifdef empty_methods_handler}. On every target where empty_methods_handler is defined, the unit no longer compiles:

uPSRuntime.pas(892) Error: E2065 Unsatisfied forward or external declaration: 'ResultAsRegister'

empty_methods_handler is defined by uPSRuntime itself for FPC on cpu64, cpuarm and cpupowerpc, and for Delphi on cpuarm and cpuarm64.

Change

ResultAsRegister does not depend on the method handler, so it is moved unchanged in front of the {$ifdef empty_methods_handler} block. No other change.

Testing

Delphi 13, a minimal program that uses uPSRuntime, uPSCompiler and uPSUtils:

  • Win64 with -Dcpuarm64 (takes the empty_methods_handler path): E2065 before, compiles after.
  • Plain Win64 and Win32: compile before and after; the Win64 code size is identical.

I have no FPC installation at hand, so the FPC cpu64 case is inferred from the same {$ifdef} structure, not compiled.

…ler block

c4657ad declared ResultAsRegister in the interface section, but its
implementation stayed inside the {$else} branch of
{$ifdef empty_methods_handler}. On every target where that symbol is
defined (FPC on cpu64, cpuarm and cpupowerpc; Delphi on cpuarm and
cpuarm64) the unit no longer compiles:

  uPSRuntime.pas(892) Error: E2065 Unsatisfied forward or external
  declaration: 'ResultAsRegister'

The function does not depend on the handler, so it is moved unchanged in
front of the block.

Reproduced with Delphi 13 by compiling uPSRuntime with -Dcpuarm64 on
Win64, which takes the empty_methods_handler path; with the change it
compiles there, and plain Win64 and Win32 builds are unaffected.
@Vizit0r

Vizit0r commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Duplicate of #313, which makes the same move of ResultAsRegister, also covers Inc/Dec on Variant and was verified on FPC. Closing in favour of it.

@Vizit0r Vizit0r closed this Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant