From d341e90237e6ca94729ed8d00082c405082688c5 Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 24 Aug 2022 16:35:05 +0200 Subject: [PATCH] Return from unreachable spot --- src/AST/MulNode.cpp | 1 + src/AST/SumNode.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/AST/MulNode.cpp b/src/AST/MulNode.cpp index 3662540..9b6281f 100644 --- a/src/AST/MulNode.cpp +++ b/src/AST/MulNode.cpp @@ -20,5 +20,6 @@ llvm::Value* MulNode::codegen(IRBuilder* generator) return generator->getBuilder()->CreateSDiv(left->codegen(generator), right->codegen(generator)); default: assert(0 && "unreachable"); + return nullptr; } } \ No newline at end of file diff --git a/src/AST/SumNode.cpp b/src/AST/SumNode.cpp index aa06956..39cc1e4 100644 --- a/src/AST/SumNode.cpp +++ b/src/AST/SumNode.cpp @@ -20,5 +20,6 @@ llvm::Value* SumNode::codegen(IRBuilder* generator) return generator->getBuilder()->CreateSub(left->codegen(generator), right->codegen(generator)); default: assert(0 && "unreachable"); + return nullptr; } } \ No newline at end of file