about summary refs log tree commit diff stats
path: root/src/dynarec/dynarec_native_pass.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-02-07 18:00:36 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-02-07 18:02:07 +0100
commit774d872f41241251fcd937cca4d7b3e3c07ba954 (patch)
tree0221ee4f09a1e9c59bd770c018b84fc5f93f76a6 /src/dynarec/dynarec_native_pass.c
parentfa19435d24a04a00739bc5b66b6dddf44fc59bd5 (diff)
downloadbox64-774d872f41241251fcd937cca4d7b3e3c07ba954.tar.gz
box64-774d872f41241251fcd937cca4d7b3e3c07ba954.zip
[DYNAREC] Tests for emited coded size limit (usefull for DYNAREC_TEST for example)
Diffstat (limited to 'src/dynarec/dynarec_native_pass.c')
-rw-r--r--src/dynarec/dynarec_native_pass.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dynarec/dynarec_native_pass.c b/src/dynarec/dynarec_native_pass.c
index 3ee9f28b..e9ef81a5 100644
--- a/src/dynarec/dynarec_native_pass.c
+++ b/src/dynarec/dynarec_native_pass.c
@@ -68,6 +68,13 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int
                 break;
             }
         }
+        // This test is here to prevent things like TABLE64 to be out of range
+        // native_size is not exact at this point, but it should be larger, not smaller, and not by a huge margin anyway
+        // so it's good enough to avoid overflow in relative to PC data fectching
+        if(dyn->native_size >= MAXBLOCK_SIZE) {
+            need_epilog = 1;
+            break;
+        }
         #endif
         ip = addr;
         if (reset_n!=-1) {