Fix: Reachable assertion (radix is to high)

This commit is contained in:
nyw0102 2024-05-21 02:11:00 +09:00
parent c94c6da65a
commit 64dba0815d

View File

@ -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 {