fix(pattern2): return Ok(None) for unpromoted LoopBodyLocal instead of Err

- Pattern2 で処理できない LoopBodyLocal は Err ではなく処理続行
- Pattern1 等に fallback させる(detection→extract→lower SSOT 維持)
- out-of-scope 変数(reassigned body-local)はreject不要

Fixes: core_direct_array_oob_set_rc_vm smoke test FAIL
Fixes: phase263_p0_pattern2_seg_min (新規テスト)
This commit is contained in:
2025-12-21 09:56:56 +09:00
parent 9d71a3b1a4
commit e0278405c0

View File

@ -119,10 +119,17 @@ impl PromoteStepBox {
inputs.read_only_body_local_slot = Some(slot);
}
PolicyDecision::Reject(reason) => {
return Err(error_messages::format_error_pattern2_promotion_failed(
&cond_body_local_vars,
&reason,
));
// Phase 263 P0: Pattern2 cannot handle reassigned body-local variables.
// Return without error to allow Pattern1 or other patterns to handle this case
// without breaking detection→extract→lower SSOT.
#[cfg(debug_assertions)]
{
eprintln!(
"[pattern2/promote_step] Cannot promote LoopBodyLocal {:?}: {}",
cond_body_local_vars, reason
);
}
// Skip promotion and continue (no-op, same as PolicyDecision::None)
}
PolicyDecision::None => {}
}