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
@@ -22,7 +22,7 @@ fn run(module: &CompiledModule) -> JsValue {
fn eval_str(source: &str) -> String {
let v = eval(source);
if v.is_string() {
unsafe { oxide_runtime_api::string_data(v) }.to_string()
oxide_runtime_api::to_string(v)
} else {
format!("{v}")
}