perf: 收紧字符串借用语义消除跨分配点 UB

This commit is contained in:
2026-08-13 16:24:00 +08:00
parent 18a0732a91
commit b7e9d18220
7 changed files with 30 additions and 12 deletions
+1 -1
View File
@@ -250,7 +250,7 @@ fn to_bigint<H: VmHost>(vm: &mut H, val: JsValue) -> Result<JsValue, JsValue> {
return Err(crate::error::create_type_error(vm, "Cannot convert a Number value to a BigInt"));
}
if val.is_string() {
let s = unsafe { oxide_runtime_api::string_data(val) }.to_string();
let s = oxide_runtime_api::to_string(val);
return match string_to_bigint(vm, &s) {
Ok(v) => Ok(v),
Err(e) => Err(e),