-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix WriteNamedBitList for enums with negative values.
WriteNamedBitList internally operates on a ulong when writing down bits. If the enum is backed by a signed type and the enum value is negative, it would be signed extended when being converted to a long, then ulong. This resulted in all negative values being written down as 64 bits set regardless of the width of the enum type. This changes the write to instead convert to the signed types corresponding unsigned type first, then converting to a ulong, which results in the value being zero extended.
- Loading branch information
Showing
3 changed files
with
139 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters