From bf9584b041891d0f079f7cd2ae44d9c1defe1e4d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 23 Oct 2003 18:39:22 +0000 Subject: Fail gracefully if we have a zero arg varargs function llvm-svn: 9436 --- llvm/lib/CWriter/Writer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp index f65d3d3..b1f8793 100644 --- a/llvm/lib/CWriter/Writer.cpp +++ b/llvm/lib/CWriter/Writer.cpp @@ -1193,6 +1193,12 @@ void CWriter::visitCallInst(CallInst &I) { Out << "va_start(*(va_list*)&" << Mang->getValueName(&I) << ", "; // Output the last argument to the enclosing function... + if (I.getParent()->getParent()->aempty()) { + std::cerr << "The C backend does not currently support zero " + << "argument varargs functions, such as '" + << I.getParent()->getParent()->getName() << "'!\n"; + abort(); + } writeOperand(&I.getParent()->getParent()->aback()); Out << ")"; return; -- cgit v1.1