Fix win32 bytecode: allow _chkstk.

Win32 needs this when stack >4k, this was the message that was logged to stderr
previously, causing the crash.
0.96
Török Edvin 15 years ago
parent 1f1b13183b
commit 4955886036
  1. 6
      libclamav/c++/bytecode2llvm.cpp

@ -290,6 +290,9 @@ static void rtlib_bzero(void *s, size_t n)
memset(s, 0, n); memset(s, 0, n);
} }
#ifdef _WIN32
extern "C" void _chkstk(void);
#endif
// Resolve integer libcalls, but nothing else. // Resolve integer libcalls, but nothing else.
static void* noUnknownFunctions(const std::string& name) { static void* noUnknownFunctions(const std::string& name) {
void *addr = void *addr =
@ -307,6 +310,9 @@ static void* noUnknownFunctions(const std::string& name) {
.Case("memcpy", (void*)(intptr_t)memcpy) .Case("memcpy", (void*)(intptr_t)memcpy)
.Case("memset", (void*)(intptr_t)memset) .Case("memset", (void*)(intptr_t)memset)
.Case("abort", (void*)(intptr_t)jit_exception_handler) .Case("abort", (void*)(intptr_t)jit_exception_handler)
#ifdef _WIN32
.Case("_chkstk", (void*)(intptr_t)_chkstk)
#endif
.Default(0); .Default(0);
if (addr) if (addr)
return addr; return addr;

Loading…
Cancel
Save