Core neg smokes: Array OOB get/set tags (set accepts null), Map missing key; Bridge canonicalize diff test (opt-in) with mutated JSON dump; Selfhost: apply child_env OOB strict guard around VM exec; Core bridge supports dump-mut env.
This commit is contained in:
@ -42,6 +42,14 @@ pub fn canonicalize_module_json(input: &str) -> Result<String, String> {
|
||||
if mutated {
|
||||
output = serde_json::to_string(&json)
|
||||
.map_err(|e| format!("bridge canonicalize: serialize error ({})", e))?;
|
||||
// Optional: dump mutated JSON for diff-based tests
|
||||
if let Ok(path) = env::var("HAKO_DEBUG_NYVM_BRIDGE_DUMP_MUT") {
|
||||
if !path.trim().is_empty() {
|
||||
if let Err(e) = fs::write(&path, output.as_bytes()) {
|
||||
eprintln!("[bridge/dump-mut] write error: {}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -229,7 +229,12 @@ impl NyashRunner {
|
||||
println!("Result: {}", code);
|
||||
std::process::exit(code);
|
||||
}
|
||||
crate::runner::child_env::pre_run_reset_oob_if_strict();
|
||||
self.execute_mir_module(&module);
|
||||
if crate::config::env::oob_strict_fail() && crate::runtime::observe::oob_seen() {
|
||||
eprintln!("[selfhost][oob-strict] Out-of-bounds observed → exit(1)");
|
||||
std::process::exit(1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
Err(e) => {
|
||||
@ -309,7 +314,12 @@ impl NyashRunner {
|
||||
}
|
||||
}
|
||||
}
|
||||
crate::runner::child_env::pre_run_reset_oob_if_strict();
|
||||
self.execute_mir_module(&module);
|
||||
if crate::config::env::oob_strict_fail() && crate::runtime::observe::oob_seen() {
|
||||
eprintln!("[selfhost][oob-strict] Out-of-bounds observed → exit(1)");
|
||||
std::process::exit(1);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user