mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
Handle zero arg function case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15794 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b47130c580
commit
7c45d7898b
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user