Files
hakorune/apps/tests/minimal_ssa_bug_loop.hako
nyash-codex 6865f4acfa feat(phi): Phase 25.1 - LoopForm v2 テスト・最小再現ケース追加
-  最小再現ケース作成
  - apps/tests/minimal_ssa_skip_ws.hako: 確実に再現する10-30行ケース
  - apps/tests/minimal_ssa_bug*.hako: 段階的簡略化版
  - apps/tests/loopform_*.hako: LoopForm v2 各ケーステスト

-  Rustテストスイート追加
  - src/tests/mir_loopform_conditional_reassign.rs: 4ケース(Case A/B/C/D)
  - src/tests/mir_loopform_complex.rs: 複雑なパターン
  - 全テストPASS確認済み

-  SSAバグ分析ドキュメント
  - docs/development/analysis/minimal_ssa_bug_analysis.md
  - エラー詳細・原因・ワークアラウンド記録

🎯 成果: SSAバグの構造を完全特定、デバッグ準備完了
2025-11-21 06:21:45 +09:00

29 lines
747 B
Plaintext

// Minimal SSA Bug Reproduction with Loop
// Pattern: Conditional reassignment inside loop with immediate usage
// Expected: SSA violation "use of undefined value"
static box MinimalSSABugLoop {
main(args) {
local src = "using foo\nusing bar\n"
local i = 0
local n = src.length()
loop(i < n) {
local line = src.substring(i, i + 10)
// Problem pattern: nested conditions with reassignment + immediate use
if line.length() > 0 {
line = line.substring(0, 5) // reassign line
if line.length() > 0 && line.substring(0, 1) == "u" { // immediate use
line = line.substring(1, 5) // another reassign
print(line)
}
}
i = i + 10
}
return 0
}
}