summaryrefslogtreecommitdiff
path: root/src/ToolBox
diff options
context:
space:
mode:
authorSergey Andreenko <seandree@microsoft.com>2018-09-28 18:57:29 -0700
committerGitHub <noreply@github.com>2018-09-28 18:57:29 -0700
commitf7f0929a468f9a4d115b51da0dc5b9328413352c (patch)
treeeea57b66743373d536631e529dcaf3cb5826fc6b /src/ToolBox
parent7d14e3a60dd9eff95e60b919cf30fd9f306e0e75 (diff)
downloadcoreclr-f7f0929a468f9a4d115b51da0dc5b9328413352c.tar.gz
coreclr-f7f0929a468f9a4d115b51da0dc5b9328413352c.tar.bz2
coreclr-f7f0929a468f9a4d115b51da0dc5b9328413352c.zip
Make `structType` optional in jitEEInterface method `getFieldType`. (#20191)
* Make `structType` optional in `getFieldType`. The declaration in corinfo.h says: "if 'structType' == 0, then don't bother the structure info". However, `getFieldTypeInternal ` did not check this case. * Do not bother the structure info when we do not need it from `getFieldType`.
Diffstat (limited to 'src/ToolBox')
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h2
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp9
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h b/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h
index 6645626c24..29c1b44711 100644
--- a/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h
+++ b/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h
@@ -508,7 +508,7 @@ CORINFO_CLASS_HANDLE getFieldClass(CORINFO_FIELD_HANDLE field);
// 'memberParent' is typically only set when verifying. It should be the
// result of calling getMemberParent.
CorInfoType getFieldType(CORINFO_FIELD_HANDLE field,
- CORINFO_CLASS_HANDLE* structType,
+ CORINFO_CLASS_HANDLE* structType = NULL,
CORINFO_CLASS_HANDLE memberParent = NULL /* IN */
);
diff --git a/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp b/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
index 7dd7d1511f..6ebe9881fb 100644
--- a/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
@@ -4245,7 +4245,14 @@ void MethodContext::recGetFieldType(CORINFO_FIELD_HANDLE field,
key.A = (DWORDLONG)field;
key.B = (DWORDLONG)memberParent;
- value.A = (DWORDLONG)*structType;
+ if (structType == nullptr)
+ {
+ value.A = 0;
+ }
+ else
+ {
+ value.A = (DWORDLONG)*structType;
+ }
value.B = (DWORD)result;
GetFieldType->Add(key, value);