From 9a477ee926e77b0eb99bca9a3e7e41629dc3021b Mon Sep 17 00:00:00 2001 From: Anton Mitrokhin Date: Mon, 23 Nov 2015 16:52:07 +0300 Subject: [PATCH] Fix bug in cbackend --- cbackend.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cbackend.cpp b/cbackend.cpp index 07af589c..5e85ccd9 100644 --- a/cbackend.cpp +++ b/cbackend.cpp @@ -4199,8 +4199,9 @@ void CWriter::visitCallInst(llvm::CallInst &I) { #else /* LLVM 3.3+ */ const llvm::AttributeSet &PAL = I.getAttributes(); #endif + bool hasByVal = I.hasByValArgument(); - bool isStructRet = I.hasStructRetAttr(); + bool isStructRet = (I.getNumArgOperands() > 0) && I.hasStructRetAttr(); if (isStructRet) { writeOperandDeref(I.getArgOperand(0)); Out << " = ";