Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.

Commit ac5f4ec

Browse files
committed
Fix unbound vars in match
1 parent 561d06e commit ac5f4ec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/lang/patterns.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ Var *Wildcard::getVar() { return var; }
4343
Value *Wildcard::codegen(BaseFunc *base, types::Type *type, Value *val,
4444
BasicBlock *&block) {
4545
LLVMContext &context = block->getContext();
46+
BasicBlock *preamble = base->getPreamble();
47+
var->store(base, type->defaultValue(preamble), preamble);
4648
var->store(base, val, block);
4749
return ConstantInt::get(IntegerType::getInt1Ty(context), 1);
4850
}

0 commit comments

Comments
 (0)