VM: PHI strict default-ON + loop-header PHI fix; add VM step budget; StringBox.lastIndexOf; docs + strict smoke
- PHI strict: default ON, disable via HAKO_VM_PHI_STRICT=0 (alias NYASH_VM_PHI_STRICT=0) - LoopForm: insert initial header PHI (preheader input) and rebind vars before condition; seal updates PHI inputs; avoid duplicate PHIs by replace - MIR interpreter: add HAKO_VM_MAX_STEPS (alias NYASH_VM_MAX_STEPS) fail-fast budget to prevent infinite loops - StringBox.lastIndexOf implemented (rfind, returns -1 when not found) in VM handlers - Smokes: add strict/core/vm_phi_strict_smoke.sh (opt-in); quick remains green 120/120 - Docs: lang/src/vm/README.md and CURRENT_TASK.md updated with PHI strict policy and step budget
This commit is contained in:
@ -37,7 +37,9 @@ impl MirInterpreter {
|
||||
);
|
||||
}
|
||||
// Dev-time safety valve: tolerate undefined registers as Void when enabled
|
||||
let tolerate = std::env::var("NYASH_VM_TOLERATE_VOID").ok().as_deref() == Some("1");
|
||||
let tolerate = std::env::var("NYASH_VM_TOLERATE_VOID").ok().as_deref() == Some("1")
|
||||
|| std::env::var("HAKO_PHI_VERIFY").ok().map(|v| v.to_ascii_lowercase()).map(|v| v=="1"||v=="true"||v=="on").unwrap_or(false)
|
||||
|| std::env::var("NYASH_PHI_VERIFY").ok().map(|v| v.to_ascii_lowercase()).map(|v| v=="1"||v=="true"||v=="on").unwrap_or(false);
|
||||
if tolerate {
|
||||
return Ok(VMValue::Void);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user