Skip to content

Commit

Permalink
Merge pull request #153 from nyw0102/kalker-skillful-perlman
Browse files Browse the repository at this point in the history
Fix: Reachable assertion (radix is to high)
  • Loading branch information
PaddiM8 committed May 21, 2024
2 parents c94c6da + 64dba08 commit bcc0f94
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kalk/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,10 @@ fn string_to_num(value: &str) -> Result<KalkFloat, KalkError> {
}

let base = get_base(value)?;

if base > 36 {
return Err(KalkError::InvalidNumberLiteral(value.into()));
}
if let Some(result) = crate::radix::parse_float_radix(&value.replace(' ', ""), base) {
Ok(crate::float!(result))
} else {
Expand Down

0 comments on commit bcc0f94

Please sign in to comment.