diff --git a/js/src/jsregexp.c b/js/src/jsregexp.c index 0b98cc1db912..c435778fbc74 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; }