On OS X, memcpy and memmove are actually aliases of the same implementation, which means the interceptor of memcpy is also invoked when memmove is called. The current implementation of the interceptor uses internal_memcpy to perform the actual memory operation, which can produce an incorrect result when memmove semantics are expected. Let's call REAL(memcpy) instead.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
I suspect there were reasons to call internal_memcpy. For example, if we intercept memcpy from dynamic loader when nothing is initialized yet, REAL(memcpy) is NULL.
We generally try to move in the opposite direction -- the less we call out from runtime, the less problems we have.
Use internal_memmove, it is already implemented.