Fix __bzero on darwin 10.

LLVM calls __bzero directly which is not allowed by libclamav.
Provide wrapper.
0.96
Török Edvin 15 years ago
parent 1ca7d19031
commit cb1260cc8e
  1. 4
      ChangeLog
  2. 6
      libclamav/c++/bytecode2llvm.cpp

@ -3,6 +3,10 @@ Fri Sep 10 10:52:45 CEST 2010 (acab)
* clamav-milter/netcode.c: fix error path fd leak when connection succeeds
but ping fails (bb#2259)
Thu Sep 9 22:07:13 EEST 2010 (edwin)
-------------------------------------
* libclamav/c++/bytecode2llvm.cpp: fix __bzero call on darwin 10.
Thu Sep 9 12:30:34 EEST 2010 (edwin)
-------------------------------------
* libclamav/bytecode.c: properly skip bytecodes with long lines.

@ -196,6 +196,11 @@ static int64_t rtlib_sra_i64(int64_t a, int32_t b)
return CLI_SRS(a, b);//CLI_./..
}
static void rtlib_bzero(void *s, size_t n)
{
memset(s, 0, n);
}
// Resolve integer libcalls, but nothing else.
static void* noUnknownFunctions(const std::string& name) {
void *addr =
@ -208,6 +213,7 @@ static void* noUnknownFunctions(const std::string& name) {
.Case("__ashrdi3", (void*)(intptr_t)rtlib_sra_i64)
.Case("__ashldi3", (void*)(intptr_t)rtlib_shl_i64)
.Case("__lshrdi3", (void*)(intptr_t)rtlib_srl_i64)
.Case("__bzero", (void*)(intptr_t)rtlib_bzero)
.Case("memmove", (void*)(intptr_t)memmove)
.Case("memcpy", (void*)(intptr_t)memcpy)
.Case("memset", (void*)(intptr_t)memset)

Loading…
Cancel
Save