diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2025-02-05 23:29:43 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2025-02-05 23:29:43 +0100 |
| commit | 69f49f79e4e2c8ee7d611fb6e5a5212fd8020132 (patch) | |
| tree | a110c3b34ac9cd10aae98c1b47705f05be01a2b5 | |
| parent | 2453eb9b2d477cb1f60d172aff61b91c281d3acb (diff) | |
| download | box64-69f49f79e4e2c8ee7d611fb6e5a5212fd8020132.tar.gz box64-69f49f79e4e2c8ee7d611fb6e5a5212fd8020132.zip | |
[DYNAREC] Fixed a potential SEGFAULT in FindDynablockFromNativeAddress, and added aprofile for BeamNG.drive linux version (for #424)
| -rw-r--r-- | src/custommem.c | 6 | ||||
| -rw-r--r-- | system/box64.box64rc | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/custommem.c b/src/custommem.c index 6846b77b..87328bc1 100644 --- a/src/custommem.c +++ b/src/custommem.c @@ -812,8 +812,10 @@ dynablock_t* FindDynablockFromNativeAddress(void* p) uintptr_t addr = (uintptr_t)p; mapchunk_t* bl = (mapchunk_t*)rb_get_64(rbt_dynmem, (uintptr_t)p); - if(bl) - return *(dynablock_t**)rb_get_64(bl->tree, (uintptr_t)p); + if(bl) { + dynablock_t** ret = (dynablock_t**)rb_get_64(bl->tree, (uintptr_t)p); + if(ret) return *ret; + } return NULL; } diff --git a/system/box64.box64rc b/system/box64.box64rc index bf405f1b..e5ca48f0 100644 --- a/system/box64.box64rc +++ b/system/box64.box64rc @@ -97,6 +97,10 @@ BOX64_PREFER_EMULATED=1 BOX64_LOG=0 BOX64_DYNAREC_ALIGNED_ATOMICS=1 +[BeamNG.drive.x64] +BOX64_MALLOC_HACK=2 +BOX64_DYNAREC_CALLRET=1 + [box64-bash] # LOG tend to mess up script execution in bash BOX64_LOG=0 |