PCRE2Project / pcre2

PCRE2 development is now based here.
Other
919 stars 191 forks source link

PCRE2 10.44 Test 8 (Internal offsets and code size) fails on 32-bit platform #425

Closed velemas closed 2 months ago

velemas commented 5 months ago

Test 8 (Internal offsets and code size) in 10.44 fails on a 32-bit platform. This happens because newly introduced parameter Memory allocation - compiled block depends on the size of the pcre2_real_code struct but it contains pointers which are 4-byte on 32-bit platforms and 8-byte on 64-bit:

re_blocksize = sizeof(pcre2_real_code) +
  CU2BYTES(length +
  (PCRE2_SIZE)cb.names_found * (PCRE2_SIZE)cb.name_entry_size);

Excerpt of test output (diff size is always 24):

--- ./testdata/testoutput8-8-2  2024-04-23 18:59:17.000000000 +0200
+++ testtry     2024-06-12 11:19:39.955800000 +0200
@@ -10,7 +10,7 @@
 #pattern fullbincode,memory

 /((?i)b)/
-Memory allocation - compiled block : 153
+Memory allocation - compiled block : 129
 Memory allocation - code portion   : 17
 ------------------------------------------------------------------
   0  13 Bra
@@ -22,7 +22,7 @@
 ------------------------------------------------------------------

 /(?s)(.*X|^B)/
-Memory allocation - compiled block : 161
+Memory allocation - compiled block : 137
 Memory allocation - code portion   : 25
carenas commented 5 months ago

there is a fix already merged in #418