Skip to content

Potential sign-extending cast when a zero-extending cast was intended #11276

@GrabYourPitchforks

Description

@GrabYourPitchforks

Testing out some new CodeQL rules locally. One of them flagged a line in WPF that appears suspicious.

This expression always returns false because an explicit cast from int -> ulong is actually treated by the compiler as int -> long -> ulong (note the intermediate implicit sign-extending cast).

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions