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
+6 -2
View File
@@ -859,7 +859,9 @@ pub fn array_flat<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
}
// HasProperty 门控:洞位不写目标(结果恒紧凑)。
if !arraylike_index_present(vm, src, i) {
stack.last_mut().unwrap().3 = i + 1;
if let Some(top) = stack.last_mut() {
top.3 = i + 1;
}
continue;
}
let elem = arraylike_get_or_err!(vm, src, i);
@@ -869,7 +871,9 @@ pub fn array_flat<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
&& !e_ptr.is_null()
&& unsafe { &*e_ptr }.is_array()
&& !stack.iter().any(|f| std::ptr::eq(f.0, e_ptr));
stack.last_mut().unwrap().3 = i + 1;
if let Some(top) = stack.last_mut() {
top.3 = i + 1;
}
if descend {
// elementLen = LengthOfArrayLike(element)。
let (_, elen, _) = match get_this_arraylike(vm, elem) {