Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the bug occurring when element type of array is not INamedType. #2730

Merged
merged 3 commits into from
Aug 7, 2019

Conversation

LLLXXXCCC
Copy link
Contributor

No description provided.

@LLLXXXCCC
Copy link
Contributor Author

#2708

@dotpaul
Copy link
Contributor

dotpaul commented Jul 31, 2019

I thought the assert was firing for params arrays. Were you able to repro against the roslyn-analysis repo?

}
}");
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Not that I'm super worried about someone putting a hardcoded key in a params byte[] array, but would we treat the params array as a tainted source if someone called MethodWithArrayParameters<byte>(1, 2, 3)? If it's easy to handle, I think we should since that would count as a constant byte array. If it's not easy to handle, we should at least put a comment somewhere that SourceInfo.TaintConstantArray doesn't handle params arrays.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This case can be handled. At the point of the invocation of MethodWithArrayParameters(1, 2, 3), it will trigger the callback of OperationKind.ArrayInitializer. A test case will be added.

Copy link
Contributor

@mavasani mavasani left a comment

Choose a reason for hiding this comment

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

LGTM. Will wait on @dotpaul's review though...

Copy link
Contributor

@dotpaul dotpaul left a comment

Choose a reason for hiding this comment

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

🚢

@LLLXXXCCC LLLXXXCCC merged commit 87d85ce into dotnet:master Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants