ref: 13c7d26dda60f87aad9e0d7bb94f11b5472782a1
parent: 15ef29e7c0ceb678f39ac12ce40bdf3484a6423b
author: Tor Andersson <tor.andersson@artifex.com>
date: Mon Jan 5 07:57:25 EST 2015
Deoptimize isalpha macro due to potential overflow errors. Silence coverity warnings.
--- a/jslex.c
+++ b/jslex.c
@@ -117,9 +117,9 @@
return c == 0xA || c == 0xD || c == 0x2028 || c == 0x2029;
}
-#define isalpha(c) ((((unsigned)(c)|32)-'a') < 26)
-#define isdigit(c) (((unsigned)(c)-'0') < 10)
-#define ishex(c) ((((unsigned)(c)|32)-'a') < 6)
+#define isalpha(c) ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
+#define isdigit(c) (c >= '0' && c <= '9')
+#define ishex(c) ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))
static int jsY_isidentifierstart(int c)
{