aboutsummaryrefslogtreecommitdiffstats
path: root/ast.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ast.cpp')
-rw-r--r--ast.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/ast.cpp b/ast.cpp
index d23ff0d..e3a3e68 100644
--- a/ast.cpp
+++ b/ast.cpp
@@ -80,8 +80,9 @@ AST::Value AST::ProcedureCall::codegen(CompilerState& state)
std::vector<llvm::Type *> argtypes;
for (auto& a : operands) {
- args.push_back(a->codegen(state));
- argtypes.push_back(args.back()->getType());
+ auto gen = a->codegen(state);
+ args.push_back(gen);
+ argtypes.push_back(gen ? gen->getType() : llvm::Type::getVoidTy(state.context));
}