On 2016-02-20 11:43:41 [+0000], Julien Cristau wrote: > > diff --git a/libclamav/yara_exec.c b/libclamav/yara_exec.c > > index dbd7ae8..eb06fbb 100644 > > --- a/libclamav/yara_exec.c > > +++ b/libclamav/yara_exec.c > [...] > > @@ -184,7 +194,7 @@ int yr_execute_code( > > #endif > > > > case OP_PUSH: > > - r1 = *(uint64_t*)(ip + 1); > > + r1 = get_unaligned_64(ip + 1); > > ip += sizeof(uint64_t); > > push(r1); > > break; > > Wouldn't "memcpy(&r1, ip + 1, sizeof(uint64_t))" be simpler? Either
The get_unaligned() might be more obvious why this is done instead of derefencing the variable like it was done. Given the optimisations the compiler can do I would expect the same code in all three cases on x86. However your memcpy() suggestion makes the resulting yara_exec.o smaller by 33 bytes so okay, I will redo it with memcpy. > way, yes, it'd be good to have it fixed in sid first. Okay. So sid, jessie and then we get back hereā¦ > Thanks, > Julien Sebastian