summaryrefslogtreecommitdiff
path: root/src/vm
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2019-06-12 13:27:12 +0200
committerGitHub <noreply@github.com>2019-06-12 13:27:12 +0200
commit10b057a0f39212386c07c36dbcc03e0555066ae3 (patch)
tree4099a5c6eca23ccbfe917d7bb6cc05a1ada09853 /src/vm
parentc3ac0c460382519c0344f3e87626846ab6fd96a1 (diff)
downloadcoreclr-10b057a0f39212386c07c36dbcc03e0555066ae3.tar.gz
coreclr-10b057a0f39212386c07c36dbcc03e0555066ae3.tar.bz2
coreclr-10b057a0f39212386c07c36dbcc03e0555066ae3.zip
Fix Module::IsInSameVersionBubble contract (#25106)
* Fix Module::IsInSameVersionBubble contract The function had an incorrect contract indicating that it cannot throw and that it cannot trigger GC. This is not true in case the underlying GetNativeAssemblyImport loads the manifest. Change the contract to STANDARD_VM_CONTRACT
Diffstat (limited to 'src/vm')
-rw-r--r--src/vm/ceeload.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/vm/ceeload.cpp b/src/vm/ceeload.cpp
index 49d5fb58b4..b1ee606f03 100644
--- a/src/vm/ceeload.cpp
+++ b/src/vm/ceeload.cpp
@@ -3420,22 +3420,16 @@ BOOL Module::IsInCurrentVersionBubble()
//
BOOL Module::IsInSameVersionBubble(Module *target)
{
- CONTRACT(BOOL)
- {
- NOTHROW;
- GC_NOTRIGGER;
- MODE_ANY;
- }
- CONTRACT_END;
+ STANDARD_VM_CONTRACT;
if (this == target)
{
- RETURN TRUE;
+ return TRUE;
}
if (!HasNativeOrReadyToRunImage())
{
- RETURN FALSE;
+ return FALSE;
}
// Check if the current module's image has native manifest metadata, otherwise the current->GetNativeAssemblyImport() asserts.
@@ -3443,7 +3437,7 @@ BOOL Module::IsInSameVersionBubble(Module *target)
const void* pMeta = GetFile()->GetOpenedILimage()->GetNativeManifestMetadata(&cMeta);
if (pMeta == NULL)
{
- RETURN FALSE;
+ return FALSE;
}
IMDInternalImport* pMdImport = GetNativeAssemblyImport();
@@ -3459,11 +3453,11 @@ BOOL Module::IsInSameVersionBubble(Module *target)
hr = pMdImport->GetAssemblyRefProps(assemblyRef, NULL, NULL, &assemblyName, NULL, NULL, NULL, NULL);
if (strcmp(assemblyName, targetName) == 0)
{
- RETURN TRUE;
+ return TRUE;
}
}
- RETURN FALSE;
+ return FALSE;
}
#endif // FEATURE_READYTORUN && !FEATURE_READYTORUN_COMPILER