WIP: Add Store instruction to MIR for variable assignments

- Added Store instruction generation in build_assignment()
- This partially addresses the VM infinite loop issue
- However, the loop still uses old values (%0) instead of updated values
- Need to implement proper SSA phi nodes for loop variables

The root cause: MIR generation doesn't properly track variable updates
in loops. Current SSA implementation lacks phi nodes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm
2025-08-18 22:04:50 +09:00
parent 8f8781219e
commit 54f7d6eb63
3 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,12 @@
// 超シンプルなVMループテスト
local i = 1
print("Before loop: i = " + i)
// 3回だけループ
loop(i <= 3) {
print("In loop: i = " + i)
i = i + 1
print("After increment: i = " + i)
}
print("After loop: i = " + i)