mirror of
https://github.com/PaddiM8/kalker.git
synced 2024-11-07 16:34:21 +01:00
Merge pull request #153 from nyw0102/kalker-skillful-perlman
Fix: Reachable assertion (radix is to high)
This commit is contained in:
commit
bcc0f947f9
@ -793,6 +793,10 @@ fn string_to_num(value: &str) -> Result<KalkFloat, KalkError> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let base = get_base(value)?;
|
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) {
|
if let Some(result) = crate::radix::parse_float_radix(&value.replace(' ', ""), base) {
|
||||||
Ok(crate::float!(result))
|
Ok(crate::float!(result))
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user