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 | 7c45d7898bdfdc29a61a58b678e13ed41333ed51 (patch) | |
tree | 51c7e13e49cc55f7eb39bd9e03863de48691d8cc /lib/ExecutionEngine/JIT/JIT.cpp | |
parent | b47130c580385a5a2c922c480a85438b2bb80293 (diff) |
Handle zero arg function case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/JIT.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/JIT.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 87331fb301..586936f21c 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/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 |