]> granicus.if.org Git - clang/commitdiff
Fix for PR2966: va_start/va_end use the *address* of the
authorEli Friedman <eli.friedman@gmail.com>
Wed, 29 Oct 2008 04:39:20 +0000 (04:39 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Wed, 29 Oct 2008 04:39:20 +0000 (04:39 +0000)
va_list, not the value.  Patch fixes an assert on
x86-64 and a wrong-code bug on x86.  I'm not completely sure,
but I think it's a regression from r58306.

Does anyone run regression tests regularly on x86-64? The crash should
have been picked up there.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58366 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBuiltin.cpp

index d08d9bc5f287ce177e65da3dc9da77465dcafac1..0032cd38beed060b183b3fb9724ee279b48f080d 100644 (file)
@@ -53,7 +53,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(unsigned BuiltinID, const CallExpr *E) {
   case Builtin::BI__builtin_stdarg_start:
   case Builtin::BI__builtin_va_start:
   case Builtin::BI__builtin_va_end: {
-    Value *ArgValue = EmitScalarExpr(E->getArg(0));
+    Value *ArgValue = EmitLValue(E->getArg(0)).getAddress();
     const llvm::Type *DestType = 
       llvm::PointerType::getUnqual(llvm::Type::Int8Ty);
     if (ArgValue->getType() != DestType)