Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Wrighton <davidwr@microsoft.com>2021-02-18 06:03:19 +0300
committerGitHub <noreply@github.com>2021-02-18 06:03:19 +0300
commit4f3545e2d1466512f53a2cd8b0db71667810c083 (patch)
tree3439d1575be09a88ccff595b83c930c9e15df0f6 /src/coreclr/utilcode
parentaa138f7cb11502043a12668f48a6bc122be27485 (diff)
Adjust logic in cor.h, corhdr.h, corinfo.h, corjit.h and such so that they may be included without the PAL (#46055)
This was done via simple substitution of the standard sized integer types, and dealing with the fallout. It is tested by using the ICorJitInfo interface directly within the crossgen2 jitinterface thunk library. Effort was made to use a minimum number of casts, as casts in such a large change are likely to be wrong somewhere. - Exceptions are the use of casting to handle some calls to the existing internal metadata api and around use of char16_t. In addition, a small amount of logic from the PAL headers were pulled into the proper header to allow compilation in the presence of some SAL annotation, and other small details.
Diffstat (limited to 'src/coreclr/utilcode')
-rw-r--r--src/coreclr/utilcode/sigparser.cpp14
-rw-r--r--src/coreclr/utilcode/util.cpp18
2 files changed, 16 insertions, 16 deletions
diff --git a/src/coreclr/utilcode/sigparser.cpp b/src/coreclr/utilcode/sigparser.cpp
index 890d508c7aa..99fbe0a083a 100644
--- a/src/coreclr/utilcode/sigparser.cpp
+++ b/src/coreclr/utilcode/sigparser.cpp
@@ -74,18 +74,18 @@ HRESULT SigParser::SkipExactlyOne()
case ELEMENT_TYPE_ARRAY:
{
IfFailRet(SkipExactlyOne()); // Skip element type
- ULONG rank;
+ uint32_t rank;
IfFailRet(GetData(&rank)); // Get rank
if (rank)
{
- ULONG nsizes;
+ uint32_t nsizes;
IfFailRet(GetData(&nsizes)); // Get # of sizes
while (nsizes--)
{
IfFailRet(GetData(NULL)); // Skip size
}
- ULONG nlbounds;
+ uint32_t nlbounds;
IfFailRet(GetData(&nlbounds)); // Get # of lower bounds
while (nlbounds--)
{
@@ -106,7 +106,7 @@ HRESULT SigParser::SkipExactlyOne()
case ELEMENT_TYPE_GENERICINST:
IfFailRet(SkipExactlyOne()); // Skip generic type
- ULONG argCnt;
+ uint32_t argCnt;
IfFailRet(GetData(&argCnt)); // Get number of parameters
while (argCnt--)
{
@@ -126,7 +126,7 @@ HRESULT SigParser::SkipExactlyOne()
//
HRESULT
SigParser::SkipMethodHeaderSignature(
- ULONG * pcArgs)
+ uint32_t * pcArgs)
{
CONTRACTL
{
@@ -141,7 +141,7 @@ SigParser::SkipMethodHeaderSignature(
HRESULT hr = S_OK;
// Skip calling convention
- ULONG uCallConv;
+ uint32_t uCallConv;
IfFailRet(GetCallingConvInfo(&uCallConv));
if ((uCallConv == IMAGE_CEE_CS_CALLCONV_FIELD) ||
@@ -180,7 +180,7 @@ HRESULT SigParser::SkipSignature()
HRESULT hr = S_OK;
- ULONG cArgs;
+ uint32_t cArgs;
IfFailRet(SkipMethodHeaderSignature(&cArgs));
diff --git a/src/coreclr/utilcode/util.cpp b/src/coreclr/utilcode/util.cpp
index cabe535e03c..018ea351c53 100644
--- a/src/coreclr/utilcode/util.cpp
+++ b/src/coreclr/utilcode/util.cpp
@@ -1850,12 +1850,12 @@ HRESULT validateOneArg(
BYTE elementType; // Current element type being processed.
mdToken token; // Embedded token.
- ULONG ulArgCnt; // Argument count for function pointer.
- ULONG ulIndex; // Index for type parameters
- ULONG ulRank; // Rank of the array.
- ULONG ulSizes; // Count of sized dimensions of the array.
- ULONG ulLbnds; // Count of lower bounds of the array.
- ULONG ulCallConv;
+ uint32_t ulArgCnt; // Argument count for function pointer.
+ uint32_t ulIndex; // Index for type parameters
+ uint32_t ulRank; // Rank of the array.
+ uint32_t ulSizes; // Count of sized dimensions of the array.
+ uint32_t ulLbnds; // Count of lower bounds of the array.
+ uint32_t ulCallConv;
HRESULT hr = S_OK; // Value returned.
BOOL bRepeat = TRUE; // MODOPT and MODREQ belong to the arg after them
@@ -2077,9 +2077,9 @@ HRESULT validateTokenSig(
}
CONTRACTL_END;
- ULONG ulCallConv; // Calling convention.
- ULONG ulArgCount = 1; // Count of arguments (1 because of the return type)
- ULONG ulTyArgCount = 0; // Count of type arguments
+ uint32_t ulCallConv; // Calling convention.
+ uint32_t ulArgCount = 1; // Count of arguments (1 because of the return type)
+ uint32_t ulTyArgCount = 0; // Count of type arguments
ULONG ulArgIx = 0; // Starting index of argument (standalone sig: 1)
ULONG i; // Looping index.
HRESULT hr = S_OK; // Value returned.