Skip to content

Commit

Permalink
Prevent VARARG and GENERIC methods parse in WalkMethods.
Browse files Browse the repository at this point in the history
Related to #101
  • Loading branch information
viewizard authored and Alexander Soldatov/Platform Lab /SRR/Staff Engineer/Samsung Electronics committed Sep 2, 2022
1 parent 3c29b95 commit 11e22bf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/debugger/evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@ static HRESULT InternalWalkMethods(ICorDebugType *pInputType, Evaluator::WalkMet
}
}

// https://github.com/dotnet/runtime/blob/57bfe474518ab5b7cfe6bf7424a79ce3af9d6657/docs/design/coreclr/profiling/davbr-blog-archive/samples/sigparse.cpp
static const ULONG SIG_METHOD_VARARG = 0x5; // vararg calling convention
static const ULONG SIG_METHOD_GENERIC = 0x10; // used to indicate that the method has one or more generic parameters.

ULONG numMethods = 0;
HCORENUM fEnum = NULL;
mdMethodDef methodDef;
Expand All @@ -434,6 +438,11 @@ static HRESULT InternalWalkMethods(ICorDebugType *pInputType, Evaluator::WalkMet
elementSize = CorSigUncompressData(pSig, &convFlags);
pSig += elementSize;

// TODO add VARARG and GENERIC methods support.
if ((convFlags & SIG_METHOD_VARARG) ||
(convFlags & SIG_METHOD_GENERIC))
continue;

// 2. count of params
elementSize = CorSigUncompressData(pSig, &cParams);
pSig += elementSize;
Expand Down

0 comments on commit 11e22bf

Please sign in to comment.