Skip to content

Conversation

@ruvaag
Copy link
Contributor

@ruvaag ruvaag commented Sep 22, 2023

Motivation

Resolve #5808 to enable disambiguous numeric hex string parsing

Solution

  • Explicitly check that numeric strings being parsed via *parseInt or *parseUint cheats don't contain any non-numeric characters
  • Throw if the above does not hold
  • Modify test added in test: add test for #5808 #5809 to verify new behavior

@ruvaag ruvaag marked this pull request as draft September 22, 2023 20:31
@ruvaag ruvaag marked this pull request as ready for review September 23, 2023 04:42
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

this looks correct, tests look good

tysm

@mattsse mattsse merged commit f6104d1 into foundry-rs:master Sep 23, 2023
@ruvaag ruvaag deleted the fix-numeric-parsing branch September 24, 2023 10:04
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.

readInt automatic base detection is a footgun

2 participants