refactor the last change
don't refer to invalid memory region by ci->ip