Skip to content

Conversation

@cirras
Copy link
Collaborator

@cirras cirras commented Mar 27, 2025

This PR adds support for 4 undocumented intrinsics that are usable within varargs routines.

Signatures for these intrinsics can be found in System:

  // procedure VarArgStart(var ArgList: TVarArgList);
  // function  VarArgGetValue(var ArgList: TVarArgList; ArgType: Type): ArgType;
  // procedure VarArgCopy(var DestArgList, SrcArgList: TVarArgList);
  // procedure VarArgEnd(var ArgList: TVarArgList);

We can't easily inject intrinsics with specific concrete types like System.TVarArgList, so I've opted for the "good enough" solution of using untyped parameters for these. I can't see any obvious way for this to result in a less inaccurate analysis (on source code that successfully compiles).

See also

@cirras cirras requested a review from fourls March 27, 2025 06:03
@cirras cirras force-pushed the varargs_intrinsics branch from 7194bdb to 76787f5 Compare March 28, 2025 05:53
Copy link
Collaborator

@fourls fourls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Now I can happily scan all my most upsetting Win64 variadics!!

@cirras cirras merged commit 76eec4d into master Mar 28, 2025
4 checks passed
@cirras cirras deleted the varargs_intrinsics branch March 28, 2025 05:58
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.

3 participants