From e056f5c8e20b2a44e71e8303c5fa183857e9b476 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 25 Jun 2004 23:06:57 +0000 Subject: [PATCH] new ReturnInst(BB) does not "do the right thing". Add an assert to catch it sooner rather than later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14421 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/iTerminators.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/llvm/iTerminators.h b/include/llvm/iTerminators.h index ddced52697e..b1c69c28192 100644 --- a/include/llvm/iTerminators.h +++ b/include/llvm/iTerminators.h @@ -35,6 +35,8 @@ class ReturnInst : public TerminatorInst { void init(Value *RetVal) { if (RetVal) { + assert(!isa(RetVal) && + "Cannot return basic block. Probably using the incorrect ctor"); Operands.reserve(1); Operands.push_back(Use(RetVal, this)); } -- 2.34.1