From 3278f12028bdef49591c07cb2b00fcd10814dc25 Mon Sep 17 00:00:00 2001 From: Stefano Sanfilippo Date: Mon, 9 Mar 2015 12:04:08 +0100 Subject: [PATCH] Assert that the value returned by FunctionPrototype bitcode emitter is a llvm::Function. --- BitcodeEmitter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BitcodeEmitter.cpp b/BitcodeEmitter.cpp index cbcb672..dbd8c0a 100644 --- a/BitcodeEmitter.cpp +++ b/BitcodeEmitter.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -552,6 +553,7 @@ bool BitcodeEmitter::emit(Function const& node) { llvm::Function *func = dynamic_cast(d->retval); d->scope.enter(); + assert(func != nullptr); llvm::BasicBlock *bb = llvm::BasicBlock::Create( getGlobalContext(), "entry", func