diff options
| author | Yang Liu <liuyang22@iscas.ac.cn> | 2025-01-14 19:47:23 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-14 12:47:23 +0100 |
| commit | fa2bd920bd2b80900de2958bed87af5a70796a54 (patch) | |
| tree | a62bc67989c4e1e140676936ee2af22c373177d0 /src | |
| parent | 613f2cccf15674f91c9b539fe2ed6f5c4a1164c8 (diff) | |
| download | box64-fa2bd920bd2b80900de2958bed87af5a70796a54.tar.gz box64-fa2bd920bd2b80900de2958bed87af5a70796a54.zip | |
[RV64_DYNAREC] Fixed offsetof(x64emu_t, scratch) usage overflow ([LA64_DYNAREC] too) (#2262)
Diffstat (limited to 'src')
| -rw-r--r-- | src/emu/x64emu_private.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/emu/x64emu_private.h b/src/emu/x64emu_private.h index ff2d6af5..a9d73937 100644 --- a/src/emu/x64emu_private.h +++ b/src/emu/x64emu_private.h @@ -110,15 +110,17 @@ typedef struct x64emu_s { forkpty_t* forkpty_info; emu_flags_t flags; x64test_t test; // used for dynarec testing + // scratch stack, used for alignment of double and 64bits ints on arm. 200 elements should be enough + __int128_t dummy_align; // here to have scratch 128bits aligned + uint64_t scratch[N_SCRATCH]; + + // Warning, offsetof(x64emu_t, xxx) will be too big for fields below. #ifdef HAVE_TRACE sse_regs_t old_xmm[16]; sse_regs_t old_ymm[16]; reg64_t oldregs[16]; uintptr_t prev2_ip; #endif - // scratch stack, used for alignment of double and 64bits ints on arm. 200 elements should be enough - __int128_t dummy_align; // here to have scratch 128bits aligned - uint64_t scratch[N_SCRATCH]; // local stack, do be deleted when emu is freed void* stack2free; // this is the stack to free (can be NULL) void* init_stack; // initial stack (owned or not) |