Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

GcInfo: Report Struct containing one GcPointer correctly #7013

Merged
merged 1 commit into from
Sep 1, 2016

Conversation

swaroop-sridhar
Copy link

This change fixes a bug in the the GcInfo header,
where the ReturnKind is reported incorrectly for certain structs.

Structs that contain only one GCPointer or ByRef, can be returned
in a single register (Windows/Unix/OSX). The ReturnKind for these
struct-returns should be RT_Object/RT_ByRef, but they are currently
incorrectly reported as RT_Scalar. This change fixes the problem.

Fixes: dotnet/corefx#11260

@swaroop-sridhar
Copy link
Author

@jkotas, @briansull: please review

@swaroop-sridhar
Copy link
Author

@dotnet-bot test Ubuntu gcstress0xc
@dotnet-bot test Windows_NT gcstress0xc
@dotnet-bot test Windows_NT arm64 checked

BYTE gcPtrs[2] = {TYPE_GC_NONE, TYPE_GC_NONE};
compiler->info.compCompHnd->getClassGClayout(structType, gcPtrs);
case TYP_REF:
case TYP_ARRAY:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TYP_ARRAY is never returned by getReturnTypeForStruct, it is confusing to include it here.

@briansull
Copy link

LGTM with comments

This change fixes a bug in the the GcInfo header,
where the ReturnKind is reported incorrectly for certain structs.

Structs that contain only one GCPointer or ByRef, can be returned
in a single register (Windows/Unix/OSX). The ReturnKind for these
struct-returns should be RT_Object/RT_ByRef, but they are currently
incorrectly reported as RT_Scalar. This change fixes the problem.

Fixes: dotnet/corefx#11260
@swaroop-sridhar
Copy link
Author

GCStress runs are here: Windows and Linux

@swaroop-sridhar swaroop-sridhar merged commit 68afd5c into dotnet:master Sep 1, 2016
@swaroop-sridhar swaroop-sridhar deleted the PtrStruct branch September 14, 2016 03:13
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
GcInfo: Report Struct containing one GcPointer correctly

Commit migrated from dotnet/coreclr@68afd5c
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AV from coreclr in immutable collections tests
3 participants