fix(joinir): Stage-1 string concat BinOp::Or → Add + ArrayBox support

Fixes:
1. BinOp::Or → BinOp::Add for string concatenation in Stage-1 lowering
2. ArrayBox/MapBox support via JoinValue::BoxRef (ChatGPT implementation)

Results:
- n=0: JoinIR → "init"  (VM → "void" PHI bug)
- n=3: JoinIR → "ABC"  (VM → "void" PHI bug)

Stage-1 JoinIR VM Bridge now fully working!

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-11-25 13:33:01 +09:00
parent 6d10fc45ba
commit e93727dd37
2 changed files with 39 additions and 29 deletions

View File

@ -252,7 +252,7 @@ fn build_stage1_using_resolver_joinir(module: &crate::mir::MirModule) -> Option<
.body
.push(JoinInst::Compute(MirLikeInst::BinOp {
dst: new_prefix,
op: BinOpKind::Or, // String concatenation uses Or in JoinIR
op: BinOpKind::Add, // String concatenation uses Add
lhs: prefix_loop,
rhs: entry_value,
}));