Verifier: enrich diagnostics with actionable hints

- Add hints for InvalidWeakRefSource/InvalidBarrierPointer/SuspiciousBarrierContext
  under NYASH_DEBUG_VERIFIER. Keeps Phi/merge/dominator hints.
- All tests green (179).
This commit is contained in:
Moe Charm
2025-08-26 06:47:13 +09:00
parent bd6b0b1f8f
commit b0537a4e59

View File

@ -168,6 +168,24 @@ impl MirVerifier {
phi_value, block, reason
);
}
VerificationError::InvalidWeakRefSource { weak_ref, block, instruction_index, reason } => {
eprintln!(
" • InvalidWeakRefSource: weak=%{:?} at {}:{} reason='{}' -- hint: source must be WeakRef(new)/WeakNew; ensure creation precedes load and value flows correctly",
weak_ref, block, instruction_index, reason
);
}
VerificationError::InvalidBarrierPointer { ptr, block, instruction_index, reason } => {
eprintln!(
" • InvalidBarrierPointer: ptr=%{:?} at {}:{} reason='{}' -- hint: barrier pointer must be a valid ref (not void/null); ensure it is defined and non-void",
ptr, block, instruction_index, reason
);
}
VerificationError::SuspiciousBarrierContext { block, instruction_index, note } => {
eprintln!(
" • SuspiciousBarrierContext: at {}:{} note='{}' -- hint: place barrier within ±2 of load/store/ref ops in same block or disable strict check",
block, instruction_index, note
);
}
other => {
eprintln!("{:?}", other);
}