summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-10-29 04:39:20 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-10-29 04:39:20 +0000
commit5adca5f02cbb26991c2ff8bf58ceee9d1ccdddea (patch)
treebe9bb4645d8aa1e7604f5d8e1d36d02b0d4b1a33 /clang/lib/CodeGen
parent3f04949b2a395d6a4afbfa3fb546a16c568f6b72 (diff)
downloadbcm5719-llvm-5adca5f02cbb26991c2ff8bf58ceee9d1ccdddea.tar.gz
bcm5719-llvm-5adca5f02cbb26991c2ff8bf58ceee9d1ccdddea.zip
Fix for PR2966: va_start/va_end use the *address* of the
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. llvm-svn: 58366
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index d08d9bc5f28..0032cd38bee 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -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)
OpenPOWER on IntegriCloud