mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2025-11-01 08:30:53 +00:00
Print better error message when wrong function is called.
This commit is contained in:
parent
6bd858662e
commit
d2171abf39
1 changed files with 9 additions and 3 deletions
|
|
@ -45,6 +45,7 @@
|
|||
#include "llvm/System/Threading.h"
|
||||
#include "llvm/Target/TargetSelect.h"
|
||||
#include "llvm/Target/TargetData.h"
|
||||
#include "llvm/Target/TargetOptions.h"
|
||||
#include "llvm/Support/TargetFolder.h"
|
||||
#include "llvm/Analysis/Verifier.h"
|
||||
#include "llvm/Transforms/Scalar.h"
|
||||
|
|
@ -978,6 +979,9 @@ int cli_vm_execute_jit(const struct cli_all_bc *bcs, struct cli_bc_ctx *ctx,
|
|||
void *code = bcs->engine->compiledFunctions[func];
|
||||
if (!code) {
|
||||
errs() << MODULE << "Unable to find compiled function\n";
|
||||
if (func->numArgs)
|
||||
errs() << MODULE << "Function has "
|
||||
<< (unsigned)func->numArgs << " arguments, it must have 0 to be called as entrypoint\n";
|
||||
return CL_EBYTECODE;
|
||||
}
|
||||
// execute;
|
||||
|
|
@ -995,7 +999,6 @@ int cli_vm_execute_jit(const struct cli_all_bc *bcs, struct cli_bc_ctx *ctx,
|
|||
return CL_EBYTECODE;
|
||||
}
|
||||
|
||||
|
||||
int cli_bytecode_prepare_jit(struct cli_all_bc *bcs)
|
||||
{
|
||||
if (!bcs->engine)
|
||||
|
|
@ -1119,6 +1122,9 @@ int bytecode_init(void)
|
|||
#endif
|
||||
atexit(do_shutdown);
|
||||
|
||||
#ifdef CL_DEBUG
|
||||
llvm::JITEmitDebugInfo = true;
|
||||
#endif
|
||||
llvm_start_multithreaded();
|
||||
|
||||
// If we have a native target, initialize it to ensure it is linked in and
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue