diff options
| author | Mike Pall <mike> | 2022-06-08 11:26:50 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2022-06-08 11:26:50 +0200 |
| commit | 96157d360db9dde81e7a3752f5c060f5111e1b07 (patch) | |
| tree | cb4f2fad934414a19fa976255f19daa2be6e8bce | |
| parent | b32e94856bf4970261e4d9d925133ba802a62d16 (diff) | |
| download | luajit-96157d360db9dde81e7a3752f5c060f5111e1b07.tar.gz luajit-96157d360db9dde81e7a3752f5c060f5111e1b07.tar.bz2 luajit-96157d360db9dde81e7a3752f5c060f5111e1b07.zip | |
Avoid zero-sized arrays in jit_State.
| -rw-r--r-- | src/lj_jit.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lj_jit.h b/src/lj_jit.h index f3c2a561..32b3861a 100644 --- a/src/lj_jit.h +++ b/src/lj_jit.h | |||
| @@ -372,6 +372,7 @@ enum { | |||
| 372 | #endif | 372 | #endif |
| 373 | LJ_K64__MAX, | 373 | LJ_K64__MAX, |
| 374 | }; | 374 | }; |
| 375 | #define LJ_K64__USED (LJ_TARGET_X86ORX64 || LJ_TARGET_MIPS) | ||
| 375 | 376 | ||
| 376 | enum { | 377 | enum { |
| 377 | #if LJ_TARGET_X86ORX64 | 378 | #if LJ_TARGET_X86ORX64 |
| @@ -390,6 +391,7 @@ enum { | |||
| 390 | #endif | 391 | #endif |
| 391 | LJ_K32__MAX | 392 | LJ_K32__MAX |
| 392 | }; | 393 | }; |
| 394 | #define LJ_K32__USED (LJ_TARGET_X86ORX64 || LJ_TARGET_PPC || LJ_TARGET_MIPS) | ||
| 393 | 395 | ||
| 394 | /* Get 16 byte aligned pointer to SIMD constant. */ | 396 | /* Get 16 byte aligned pointer to SIMD constant. */ |
| 395 | #define LJ_KSIMD(J, n) \ | 397 | #define LJ_KSIMD(J, n) \ |
| @@ -444,9 +446,13 @@ typedef struct jit_State { | |||
| 444 | int32_t framedepth; /* Current frame depth. */ | 446 | int32_t framedepth; /* Current frame depth. */ |
| 445 | int32_t retdepth; /* Return frame depth (count of RETF). */ | 447 | int32_t retdepth; /* Return frame depth (count of RETF). */ |
| 446 | 448 | ||
| 449 | #if LJ_K32__USED | ||
| 447 | uint32_t k32[LJ_K32__MAX]; /* Common 4 byte constants used by backends. */ | 450 | uint32_t k32[LJ_K32__MAX]; /* Common 4 byte constants used by backends. */ |
| 451 | #endif | ||
| 448 | TValue ksimd[LJ_KSIMD__MAX*2+1]; /* 16 byte aligned SIMD constants. */ | 452 | TValue ksimd[LJ_KSIMD__MAX*2+1]; /* 16 byte aligned SIMD constants. */ |
| 453 | #if LJ_K64__USED | ||
| 449 | TValue k64[LJ_K64__MAX]; /* Common 8 byte constants. */ | 454 | TValue k64[LJ_K64__MAX]; /* Common 8 byte constants. */ |
| 455 | #endif | ||
| 450 | 456 | ||
| 451 | IRIns *irbuf; /* Temp. IR instruction buffer. Biased with REF_BIAS. */ | 457 | IRIns *irbuf; /* Temp. IR instruction buffer. Biased with REF_BIAS. */ |
| 452 | IRRef irtoplim; /* Upper limit of instuction buffer (biased). */ | 458 | IRRef irtoplim; /* Upper limit of instuction buffer (biased). */ |
