fix memcpy-param-overlap

See #2189. I still don't know why the parameters overlap. I can't reproduce this error locally.