Re: [RFC/PATCH 2/2] sparse, llvm: Fix varargs functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/01/2012 05:47 AM, Benjamin Herrenschmidt wrote:
On Wed, 2012-02-01 at 11:55 +0200, Pekka Enberg wrote:
From: Benjamin Herrenschmidt<benh@xxxxxxxxxxxxxxxxxxx>

We need to tell llvm about it or it won't generate the proper
stack frame&  argument list on some architectures.

Cc: Christopher Li<sparse@xxxxxxxxxxx>
Cc: Jeff Garzik<jgarzik@xxxxxxxxxx>
Cc: Linus Torvalds<torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Benjamin Herrenschmidt<benh@xxxxxxxxxxxxxxxxxxx>
[ penberg@xxxxxxxxxx: Fix function pointer calls ]
Signed-off-by: Pekka Enberg<penberg@xxxxxxxxxx>
---
  sparse-llvm.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sparse-llvm.c b/sparse-llvm.c
index a291a0d..9226a21 100644
--- a/sparse-llvm.c
+++ b/sparse-llvm.c
@@ -79,7 +79,7 @@ static LLVMTypeRef sym_func_type(LLVMModuleRef module, struct symbol *sym)
  		arg_type[idx++] = symbol_type(module, arg_sym);
  	} END_FOR_EACH_PTR(arg);
  	func_type = LLVMFunctionType(ret_type, arg_type, n_arg,
-				     /* varargs? */ 0);
+				     sym->ctype.base_type->variadic);

  	return func_type;
  }

Is the above hunk correct ? It was really just a guess, I haven't tested
that code path :-)

I was wondering that, myself :)  Need coffee, then testing, I suppose :)

	Jeff




--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux