From: Chris Lattner Date: Thu, 23 Oct 2003 18:39:22 +0000 (+0000) Subject: Fail gracefully if we have a zero arg varargs function X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4065ef99f91f929e4e0305cbd22b44873bbe66ab;p=oota-llvm.git Fail gracefully if we have a zero arg varargs function git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9436 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index f65d3d322ef..b1f8793d64d 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.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; diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index f65d3d322ef..b1f8793d64d 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/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;