Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
memory_model: fix a corner case of read_to_memory()/write_from_memory()
The implementation of read_to_memory()/write_from_memory() assumes that all content comes from the same MemoryRegion, and they just fails if the content crosses MemoryRegion boundary. From the caller's point of view, they don't know whether the content crosses MemoryRegion boundary. So enhance read_to_memory()/write_from_memory() to correctly handle those cases. Also refine the implementation of read_obj_from_addr()/write_obj_at_addr() without functional changes. In case of failure, the content in target buffer/object is undefined. Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
- Loading branch information
Showing
1 changed file
with
90 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters