[llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Aug 9 17:19:26 PDT 2004



Changes in directory llvm/lib/Target/CBackend:

Writer.cpp updated: 1.192 -> 1.193
---
Log message:

Paper over CBackend/2004-08-09-va-end-null.ll

Note that this indicates a serious problem with the way we are emitting varargs,
but this should not be properly fixed until after 1.3.

This patch SHOULD go into 1.3.



---
Diffs of the changes:  (+7 -3)

Index: llvm/lib/Target/CBackend/Writer.cpp
diff -u llvm/lib/Target/CBackend/Writer.cpp:1.192 llvm/lib/Target/CBackend/Writer.cpp:1.193
--- llvm/lib/Target/CBackend/Writer.cpp:1.192	Sun Jul 25 17:36:35 2004
+++ llvm/lib/Target/CBackend/Writer.cpp	Mon Aug  9 19:19:16 2004
@@ -1390,9 +1390,13 @@
         Out << ")";
         return;
       case Intrinsic::vaend:
-        Out << "va_end(*(va_list*)&";
-        writeOperand(I.getOperand(1));
-        Out << ")";
+        if (!isa<ConstantPointerNull>(I.getOperand(1))) {
+          Out << "va_end(*(va_list*)&";
+          writeOperand(I.getOperand(1));
+          Out << ")";
+        } else {
+          Out << "va_end(*(va_list*)0)";
+        }
         return;
       case Intrinsic::vacopy:
         Out << "0;";






More information about the llvm-commits mailing list