summaryrefslogtreecommitdiffstats
path: root/llvm/tools/jello/VM.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/jello/VM.cpp')
-rw-r--r--llvm/tools/jello/VM.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/tools/jello/VM.cpp b/llvm/tools/jello/VM.cpp
index 5b0bf2f4ec3..e5e77c3e275 100644
--- a/llvm/tools/jello/VM.cpp
+++ b/llvm/tools/jello/VM.cpp
@@ -38,9 +38,14 @@ void VM::setupPassManager() {
}
int VM::run(Function *F) {
- int(*PF)() = (int(*)())getPointerToFunction(F);
+ int(*PF)(int, char**) = (int(*)(int, char**))getPointerToFunction(F);
assert(PF != 0 && "Null pointer to function?");
- return PF();
+
+ unsigned NumArgs = 0;
+ for (; Argv[NumArgs]; ++NumArgs)
+ ;
+
+ return PF(NumArgs, Argv);
}
void *VM::resolveFunctionReference(void *RefAddr) {
OpenPOWER on IntegriCloud