From b0537a4e59535e9aeb61d4b7e4719dea25d529c8 Mon Sep 17 00:00:00 2001 From: Moe Charm Date: Tue, 26 Aug 2025 06:47:13 +0900 Subject: [PATCH] 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). --- src/mir/verification.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/mir/verification.rs b/src/mir/verification.rs index 0eca97d3..16379b5e 100644 --- a/src/mir/verification.rs +++ b/src/mir/verification.rs @@ -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); }