-
how to check if a method parameter is ArgList (__argList) Type? |
Beta Was this translation helpful? Give feedback.
Answered by
Washi1337
Apr 17, 2024
Replies: 1 comment 2 replies
-
MethodDefinition somemethod = ... ;
var sig = somemethod.Signature;
var isHasArgList = sig.Attributes.HasFlag(AsmResolver.DotNet.Signatures.CallingConventionAttributes.VarArg);
// or
var isHasArgList = sig.CallingConvention == AsmResolver.DotNet.Signatures.CallingConventionAttributes.VarArg; |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
__arglist
parameter in C# does not actually translate to a physical parameter definition or type in the metadata/signature.__arglist
is just C# syntax for thevararg
calling convention, indicating there may be more arguments passed into the function beyond the ones defined in the method's signature.See: https://sharplab.io/#v2:EYLgZgpghgLgrgJwgZwLQGED2AbbEDGMAlpgHYAyRMECU2yANDCEdgD4ACATAIwCwAKEEcAzAAJuEngHZBAb0FilE8RwAsYgLIAKIqRhiAHgzEB9U1AQBzbEWQwAlIuUKBysQF9BzpaIkaAOW0nNxcfdy1tHhERaRNzSxs7GCiTLhMRBwcAbnCvAQ8gA