diff options
author | Chris Lattner <sabre@nondot.org> | 2004-08-15 23:31:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-08-15 23:31:43 +0000 |
commit | 47380e3ba07a32353fd6bd16bd6a1cf3e1768c3a (patch) | |
tree | c59a6fefbfd5cfae5ba95cb6b47bf37b92a6fa00 | |
parent | a349c03347d1c52d1d2bb0f83b7a0e9550d6ab2a (diff) | |
download | bcm5719-llvm-47380e3ba07a32353fd6bd16bd6a1cf3e1768c3a.tar.gz bcm5719-llvm-47380e3ba07a32353fd6bd16bd6a1cf3e1768c3a.zip |
Handle zero arg function case
llvm-svn: 15794
-rw-r--r-- | llvm/lib/ExecutionEngine/JIT/JIT.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JIT.cpp b/llvm/lib/ExecutionEngine/JIT/JIT.cpp index 87331fb3015..586936f21c7 100644 --- a/llvm/lib/ExecutionEngine/JIT/JIT.cpp +++ b/llvm/lib/ExecutionEngine/JIT/JIT.cpp @@ -62,7 +62,7 @@ GenericValue JIT::runFunction(Function *F, GenericValue rv; void *FPtr = getPointerToFunction(F); - assert(PFtr && "Pointer to fn's code was null after getPointerToFunction"); + assert(FPtr && "Pointer to fn's code was null after getPointerToFunction"); if (ArgValues.size() == 3) { int (*PF)(int, char **, const char **) = @@ -76,6 +76,10 @@ GenericValue JIT::runFunction(Function *F, int (*PF)(int) = (int(*)(int))FPtr; rv.IntVal = PF(ArgValues[0].IntVal); return rv; + } else if (ArgValues.size() == 0) { + int (*PF)() = (int(*)())FPtr; + rv.IntVal = PF(); + return rv; } // FIXME: This code should handle a couple of common cases efficiently, but |