From 26edb6cb4370177f8a2d627bbd390c28503804ac Mon Sep 17 00:00:00 2001 From: "Philip.Hazel" Date: Wed, 28 Feb 2018 09:03:12 +0000 Subject: [PATCH] Minor tweak to the m68k patch. --- src/pcre2_intmodedep.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/pcre2_intmodedep.h b/src/pcre2_intmodedep.h index d744e39..f5805aa 100644 --- a/src/pcre2_intmodedep.h +++ b/src/pcre2_intmodedep.h @@ -796,11 +796,12 @@ typedef struct heapframe { /* At this point, the structure is 16-bit aligned. On most architectures the alignment requirement for a pointer will ensure that the eptr field below is 32-bit or 64-bit aligned. However, on m68k it is fine to have a pointer - that is 16-bit aligned. We must therefore ensure that the occu vector is an - odd multiple of 16 bits so as to get back into 32-bit alignment. This happens - naturally when PCRE2_UCHAR is 8 bits wide, but needs fudges in the other - cases. Without these, this structure is no longer a multiple of PCRE2_SIZE - and the check below fails. */ + that is 16-bit aligned. We must therefore ensure that what comes between here + and eptr is an odd multiple of 16 bits so as to get back into 32-bit + alignment. This happens naturally when PCRE2_UCHAR is 8 bits wide, but needs + fudges in the other cases. In the 32-bit case the padding comes first so that + the occu field itself is 32-bit aligned. Without the padding, this structure + is no longer a multiple of PCRE2_SIZE on m68k, and the check below fails. */ #if PCRE2_CODE_UNIT_WIDTH == 8 PCRE2_UCHAR occu[6]; /* Used for other case code units */ @@ -808,8 +809,8 @@ typedef struct heapframe { PCRE2_UCHAR occu[2]; /* Used for other case code units */ uint8_t unused[2]; /* Ensure 32-bit alignment (see above) */ #else - PCRE2_UCHAR occu[1]; /* Used for other case code units */ uint8_t unused[2]; /* Ensure 32-bit alignment (see above) */ + PCRE2_UCHAR occu[1]; /* Used for other case code units */ #endif /* The rest have to be copied from the previous frame whenever a new frame @@ -829,7 +830,7 @@ typedef struct heapframe { PCRE2_SIZE ovector[131072]; /* Must be last in the structure */ } heapframe; -/* This typedef is a check that the size of the heapframe structure is a +/* This typedef is a check that the size of the heapframe structure is a multiple of PCRE2_SIZE. See various comments above. */ typedef char check_heapframe_size[