diff options
| author | Chi-Kuan Chiu <105687635+devarajabc@users.noreply.github.com> | 2025-05-03 17:40:29 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-03 11:40:29 +0200 |
| commit | 5ee43854771d711cc75fa75693efcd11e933498c (patch) | |
| tree | f2375abebe1d27927c1286d983ee6b3253316bda /src/tools | |
| parent | 25000d0903a23dc942ad7ce2c7d289838b8af907 (diff) | |
| download | box64-5ee43854771d711cc75fa75693efcd11e933498c.tar.gz box64-5ee43854771d711cc75fa75693efcd11e933498c.zip | |
Use `setProtection_mmap` in `NewBrick` (#2599)
NewBrick() currently uses setProtection() after box_mmap(), which fails to mark the region with the `MEM_MMAP` label. As a result, getMmapped() returns 0, even though the memory was allocated via mmap. Closes #2598
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/bridge.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/bridge.c b/src/tools/bridge.c index 1ad0c3e5..e9669fa2 100644 --- a/src/tools/bridge.c +++ b/src/tools/bridge.c @@ -55,7 +55,7 @@ brick_t* NewBrick(void* old) if(ptr == MAP_FAILED) { printf_log(LOG_NONE, "Warning, cannot allocate 0x%lx aligned bytes for bridge, will probably crash later\n", NBRICK*sizeof(onebridge_t)); } - setProtection((uintptr_t)ptr, NBRICK * sizeof(onebridge_t), PROT_READ | PROT_WRITE | PROT_EXEC | PROT_NOPROT); + setProtection_mmap((uintptr_t)ptr, NBRICK * sizeof(onebridge_t), PROT_READ | PROT_WRITE | PROT_EXEC | PROT_NOPROT); dynarec_log(LOG_INFO, "New Bridge brick at %p (size 0x%zx)\n", ptr, NBRICK*sizeof(onebridge_t)); if(box64_is32bits) load_addr_32bits = ptr + NBRICK*sizeof(onebridge_t); ret->b = ptr; |