SimEng icon indicating copy to clipboard operation
SimEng copied to clipboard

Implicit conversion from `uint64_t` to `int64_t` caused by return value of `MemRegion::mmapRegion`

Open rahahahat opened this issue 2 years ago • 0 comments

The mmapRegion function calls the addVma function which returns the address of the newly allocated virtual memory area. The return value of addVma is uint64_t; whereas the return value of mmapRegion is int64_t

The return value is mmapRegion is int64_t because on error the mmap syscall returns the value MAP_FAILED ((void *) -1), and errno is set to indicate the error.

rahahahat avatar Jun 06 '23 13:06 rahahahat