Skip to content

Commit 2234112

Browse files
committed
regcomp.c: Code points can be UV; not just IV
This converts from using IV to UV. Code points are currently restricted to 0..IV_MAX, but the intern is to use values outside that range for internal purposes. This avoids any potential issues with printing an IV in hex format
1 parent bc7848f commit 2234112

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

regcomp.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16328,7 +16328,7 @@ S_handle_names_wildcard(pTHX_ const char * wname, /* wildcard name to match */
1632816328
* were returned to us in the array 'algorithmic_names' from data in
1632916329
* lib/unicore/Name.pm. 'code_point' in the name is expressed in hex. */
1633016330
for (i = 0; i <= av_top_index((AV *) algorithmic_names); i++) {
16331-
IV j;
16331+
UV j;
1633216332

1633316333
/* Each element of the array is a hash, giving the details for the
1633416334
* series of names it covers. There is the base name of the characters
@@ -16337,8 +16337,8 @@ S_handle_names_wildcard(pTHX_ const char * wname, /* wildcard name to match */
1633716337
* characters that could possibly be in a name in this series. */
1633816338
HV * this_series = (HV *) SvRV(* av_fetch((AV *) algorithmic_names, i, 0));
1633916339
SV * prefix = * hv_fetchs(this_series, "name", 0);
16340-
IV low = SvIV(* hv_fetchs(this_series, "low", 0));
16341-
IV high = SvIV(* hv_fetchs(this_series, "high", 0));
16340+
UV low = SvUV(* hv_fetchs(this_series, "low", 0));
16341+
UV high = SvUV(* hv_fetchs(this_series, "high", 0));
1634216342
char * legal = SvPVX(* hv_fetchs(this_series, "legal", 0));
1634316343

1634416344
/* Pre-allocate an SV with enough space */
@@ -16359,8 +16359,7 @@ S_handle_names_wildcard(pTHX_ const char * wname, /* wildcard name to match */
1635916359
for (j = low; j <= high; j++) { /* For each code point in the series */
1636016360

1636116361
/* Get its name, and see if it matches the subpattern */
16362-
sv_setpvf(algo_name, "%s-%X", SvPVX(prefix),
16363-
(unsigned) j);
16362+
sv_setpvf(algo_name, "%s-%" UVXf, SvPVX(prefix), j);
1636416363

1636516364
if (execute_wildcard(subpattern_re,
1636616365
SvPVX(algo_name),

0 commit comments

Comments
 (0)