Fix Replace_memcpy crash

Fix Replace_memcpy crash in #5496
Merge pull request #6248 from sum2012/Replace-table

Fix Replace_memcpy crash