[Clamav-devel] Bug on file JITDebugRegister file. it's take effect to LLVMjit cannot build sub project success. In ClamAV version 0.98.1.

Chatsiri Rattana insiderboy at gmail.com
Fri Apr 25 21:07:48 EDT 2014


Hello All,

   I found incorrect code on sub-project LLVMjit. It cannot built source
code success because using std::make_pair<std::string,
jit_code_entry*>(Buffer, JITCodeEntry);   in line 146. Follow line of code
as file name is JITDebugRegister.cpp.

 FnMap[F] = std::make_pair<std::string, jit_code_entry*>(Buffer,
JITCodeEntry);

It should be example code below.

 FnMap[F] = std::pair<std::string, jit_code_entry*>(Buffer, JITCodeEntry);

In declaration variable  FnMap[F] is type definition declares as below in
file name JITDebugRegister.h

typedef DenseMap< const Function*, std::pair<std::string, jit_code_entry*> >
  RegisteredFunctionsMap;

FnMap[F] must lvalue received value std::pair<std::string,
jit_code_entry*>(Buffer, JITCodeEntry); more std::map<T,T2>(), Thus source
code use std::pair<T,T2>() instead std::make_pair(). Program will compiler
source code success.

Example fixed bug in line 14 from my gits:
https://gist.github.com/Chatsiri/11295674

I'm build source code in Microsoft Visual Studio 2013 (Version 12.0.21005.1
REL), Windows 7
Repository : https://github.com/vrtadmin/clamav-devel

Best Regards,
R.Chatsiri.



-- 
:--------------------------------------------------------


More information about the clamav-devel mailing list