diff --git a/js/src/jsregexp.c b/js/src/jsregexp.c index 0b98cc1db91..c435778fbc7 100644 --- a/js/src/jsregexp.c +++ b/js/src/jsregexp.c @@ -1055,7 +1055,10 @@ lexHex: break; } if (state->flags & JSREG_FOLD) { - c = (jschar) JS_MAX(upcase(localMax), downcase(localMax)); + jschar uc = upcase(localMax); + jschar dc = downcase(localMax); + + c = JS_MAX(uc, dc); if (c > localMax) localMax = c; }