8000 Fail gracefully if we have a zero arg varargs function · inside-compiler/llvm-project@bf9584b · GitHub
[go: up one dir, main page]

Skip to content

Commit bf9584b

Browse files
committed
Fail gracefully if we have a zero arg varargs function
llvm-svn: 9436
1 parent 95ee0b0 commit bf9584b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/CWriter/Writer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,12 @@ void CWriter::visitCallInst(CallInst &I) {
11931193

11941194
Out << "va_start(*(va_list*)&" << Mang->getValueName(&I) << ", ";
11951195
// Output the last argument to the enclosing function...
1196+
if (I.getParent()->getParent()->aempty()) {
1197+
std::cerr << "The C backend does not currently support zero "
1198+
<< "argument varargs functions, such as '"
1199+
<< I.getParent()->getParent()->getName() << "'!\n";
1200+
abort();
1201+
}
11961202
writeOperand(&I.getParent()->getParent()->aback());
11971203
Out << ")";
11981204
return;

0 commit comments

Comments
 (0)
0