diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2012-06-06 09:37:41 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2012-06-06 09:37:41 +0200 |
commit | 1dc551ae9b5f79f845d77792bd0d18e0fcae78bc (patch) | |
tree | f727a90e19cdbf618fe990ba6cd39fc24954af69 /qv4isel_llvm.cpp | |
parent | b353942bfa05898dceb0ae6ee4ab08ec76c0fc5b (diff) |
Fix the return value of calls.
Diffstat (limited to 'qv4isel_llvm.cpp')
-rw-r--r-- | qv4isel_llvm.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/qv4isel_llvm.cpp b/qv4isel_llvm.cpp index 64ca9a9554..5f186505b0 100644 --- a/qv4isel_llvm.cpp +++ b/qv4isel_llvm.cpp @@ -374,7 +374,11 @@ void LLVMInstructionSelection::visitCall(IR::Call *e) ++argc; } - llvm::Value *args = argc ? CreateAlloca(_valueTy, getInt32(argc)) : 0; + llvm::Value *args = 0; + if (argc) + args = CreateAlloca(_valueTy, getInt32(argc)); + else + args = llvm::Constant::getNullValue(_valueTy->getPointerTo()); int i = 0; for (IR::ExprList *it = e->args; it; it = it->next) { @@ -385,7 +389,8 @@ void LLVMInstructionSelection::visitCall(IR::Call *e) if (func) { llvm::Value *result = CreateAlloca(_valueTy); CreateStore(llvm::Constant::getNullValue(_valueTy), result); - _llvmValue = CreateCall5(func, _llvmFunction->arg_begin(), result, base, args, getInt32(argc)); + CreateCall5(func, _llvmFunction->arg_begin(), result, base, args, getInt32(argc)); + _llvmValue = CreateLoad(result); } else { Q_UNIMPLEMENTED(); } |