fix mem invalid read/write
Merge pull request #154 from GXhua/master

fix mem invalid read/write