From 3188b73642df785db3bb64044194c953eab93b02 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 26 Jan 2006 00:08:45 +0000 Subject: [PATCH] Make sure the only user of InlineAsm's are direct calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25626 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Verifier.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 36462388b38..8113d5bbbcd 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -47,6 +47,7 @@ #include "llvm/Module.h" #include "llvm/ModuleProvider.h" #include "llvm/DerivedTypes.h" +#include "llvm/InlineAsm.h" #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" #include "llvm/PassManager.h" @@ -663,6 +664,9 @@ void Verifier::visitInstruction(Instruction &I) { !EF->dominates(&BB->getParent()->getEntryBlock(), PredBB), "Instruction does not dominate all uses!", Op, &I); } + } else if (isa(I.getOperand(i))) { + Assert1(i == 0 && isa(I), + "Cannot take the address of an inline asm!", &I); } } InstsInThisBlock.insert(&I);