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(gnovm): allow multiple NaN keys in maps #3932

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix lint
mvertes committed Mar 13, 2025
commit 32ba53580918733396adec7acb42a1fdba826001
5 changes: 3 additions & 2 deletions gnovm/pkg/gnolang/values.go
Original file line number Diff line number Diff line change
@@ -1459,12 +1459,13 @@ func (tv *TypedValue) AssertNonNegative(msg string) {
}
}

// uvnan is the unsigned value of NaN. It can be contructed by applying the following:
// uvnan is the unsigned value of NaN. It can be obtained by applying the following:
// { var nan = math.NaN(); var uvnan = *(*uint64)(unsafe.Pointer(&nan)) }
const uvnan = 0x7FF8000000000001

// randNaN returns an uint64 representation of NaN with a random payload.
// randNaN returns an uint64 representation of NaN with a random payload of 53 bits.
func randNaN() uint64 {
//nolint: gosec
return rand.Uint64()&^uvnan | uvnan
}