Protect against calling a function with an unexpected signature.

This commit is contained in:
Vassil Vassilev 2014-03-12 15:18:04 +01:00 committed by Axel Naumann
parent 4e4d39d389
commit fff83003a6

View File

@ -175,6 +175,9 @@ IncrementalExecutor::executeFunction(llvm::StringRef funcname,
"could not find function named " << funcname << '\n'; "could not find function named " << funcname << '\n';
return kExeFunctionNotCompiled; return kExeFunctionNotCompiled;
} }
assert (f->getFunctionType()->getNumParams() == 1
&& (*f->getFunctionType()->param_begin())->isPtrOrPtrVectorTy() &&
"Wrong signature");
typedef void (*PromptWrapper_t)(void*); typedef void (*PromptWrapper_t)(void*);
union { union {
PromptWrapper_t wrapperFunction; PromptWrapper_t wrapperFunction;