Re: Assert failure with ICU support
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Richard Guo <guofenglinux@gmail.com>,
PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2023-04-19T20:45:48Z
Lists: pgsql-bugs
Jeff Davis <pgsql@j-davis.com> writes: > We should probably just check that it's plain ASCII. That was about the same conclusion I came to. More or less c = *v->now++; - if (!iscalnum(c)) + if (!isascii(c) || !iscalnum(c)) RETV(PLAIN, c); although I'm not sure if it's a good idea to apply isascii() to something that's wider than char. It might be advisable, if ugly, to write + if (c >= 0x100 || !iscalnum(c)) I'm also inclined to remove that "assert(iscalpha(c))" in the switch. That's not checking sanity of our own code, just consistency of the <wctype.h> functions; and as this episode shows it's more trouble than it's worth. regards, tom lane
Commits
-
Avoid character classification in regex escape parsing.
- 106a1bf824ce 11.20 landed
- 5bcb15b8163a 12.15 landed
- 79a66c617ae3 13.11 landed
- dde926b0f67d 14.8 landed
- 109363de0a89 15.3 landed
- c04c6c5d6f5f 16.0 landed