fix: 修复 oxide_builtins 整数溢出 panic 点与安全转换

This commit is contained in:
2026-09-21 14:11:20 +00:00
parent b4d281d109
commit fea24b6d26
19 changed files with 291 additions and 91 deletions
+1 -1
View File
@@ -197,7 +197,7 @@ pub fn number_parse_int<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
} else {
let mut acc = 0.0f64;
for c in prefix.chars() {
acc = acc * radix as f64 + c.to_digit(radix).unwrap() as f64;
acc = acc * radix as f64 + c.to_digit(radix).unwrap_or(0) as f64;
}
acc
};