Skip to content

Conversation

@kasperk81
Copy link
Contributor

@kasperk81 kasperk81 commented Sep 21, 2024

No description provided.

@ghost ghost added the area-VM-coreclr label Sep 21, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Sep 21, 2024
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

// Concatenate type names to assembly names
//*****************************************************************************
static
bool MakeAssemblyQualifiedName( // true if ok, false if out of memory
Copy link
Member

Choose a reason for hiding this comment

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

MakeAssemblyQualifiedName methods look like dead code. Could you please delete them instead?

@kasperk81 kasperk81 changed the title fix a typo delete deadcode from nsutilpriv.h Sep 21, 2024
int dwAssemblyName); // Number of characters (not including null)

static
int MakeNestedTypeName( // true ok, false out of memory
Copy link
Member

Choose a reason for hiding this comment

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

MakeNestedTypeName is used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

only third one with stack string is in use

// Concatinate type names to assembly names
//*****************************************************************************
static
bool MakeAssemblyQualifiedName( // true if ok, false if out of memory
Copy link
Member

Choose a reason for hiding this comment

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

Comment on lines 153 to 156
#ifdef _PREFAST_
// need to set ptr=NULL so we don't get a build error because ptr isn't inited in a couple cases
#define MAKE_FULLY_QUALIFIED_MEMBER_NAME(ptr, pszNameSpace, pszClassName, pszMemberName, pszSig) ptr=NULL;
#else //_PREFAST_
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#ifdef _PREFAST_
// need to set ptr=NULL so we don't get a build error because ptr isn't inited in a couple cases
#define MAKE_FULLY_QUALIFIED_MEMBER_NAME(ptr, pszNameSpace, pszClassName, pszMemberName, pszSig) ptr=NULL;
#else //_PREFAST_

This should not be needed.

int __i##ptr = ns::GetFullLength(pszNameSpace, pszClassName); \
__i##ptr += (pszMemberName ? (int) strlen(pszMemberName) : 0); \
__i##ptr += (NAMESPACE_SEPARATOR_LEN * 2); \
__i##ptr += (int)strlen(NAMESPACE_SEPARATOR_STR) + 1; \
Copy link
Member

Choose a reason for hiding this comment

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

This change does not look right. The code below adds NAMESPACE_SEPARATOR_STR up to two times, so it makes sense that NAMESPACE_SEPARATOR_LEN was multiplied by two.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks

@jkotas jkotas merged commit 619d4b3 into dotnet:main Sep 22, 2024
@kasperk81 kasperk81 deleted the patch-5 branch September 23, 2024 23:05
sirntar pushed a commit to sirntar/runtime that referenced this pull request Sep 30, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-VM-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants