From 1298118b59eb2a39bfe5653755a68384be84544b Mon Sep 17 00:00:00 2001 From: xushiwei Date: Tue, 25 Jun 2024 13:31:44 +0800 Subject: [PATCH] phi.AddIncoming fix: use checkExpr --- ssa/stmt_builder.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ssa/stmt_builder.go b/ssa/stmt_builder.go index ca20e88d..15e0b570 100644 --- a/ssa/stmt_builder.go +++ b/ssa/stmt_builder.go @@ -290,10 +290,12 @@ type Phi struct { // AddIncoming adds incoming values to a phi node. func (p Phi) AddIncoming(b Builder, preds []BasicBlock, f func(i int, blk BasicBlock) Expr) { + raw := p.raw.Type bs := llvmPredBlocks(preds) vals := make([]llvm.Value, len(preds)) for iblk, blk := range preds { - vals[iblk] = f(iblk, blk).impl + val := f(iblk, blk) + vals[iblk] = checkExpr(val, raw, b).impl } p.impl.AddIncoming(vals, bs) }