//
// file: regexcmp.cpp
//
-// Copyright (C) 2002-2015 International Business Machines Corporation and others.
+// Copyright (C) 2002-2016 International Business Machines Corporation and others.
// All Rights Reserved.
//
// This file contains the ICU regular expression compiler, which is responsible
fMatchOpenParen = -1;
fMatchCloseParen = -1;
fCaptureName = NULL;
+ fLastSetLiteral = U_SENTINEL;
if (U_SUCCESS(status) && U_FAILURE(rxp->fDeferredStatus)) {
status = rxp->fDeferredStatus;
// and ICU UnicodeSet behavior.
{
UChar32 c = scanNamedChar();
- if (U_SUCCESS(*fStatus) && fLastSetLiteral > c) {
+ if (U_SUCCESS(*fStatus) && (fLastSetLiteral == U_SENTINEL || fLastSetLiteral > c)) {
error(U_REGEX_INVALID_RANGE);
}
UnicodeSet *s = (UnicodeSet *)fSetStack.peek();
// Lower Limit > Upper limit being an error matches both Java
// and ICU UnicodeSet behavior.
{
- if (fLastSetLiteral > fC.fChar) {
+
+ if (fLastSetLiteral == U_SENTINEL || fLastSetLiteral > fC.fChar) {
error(U_REGEX_INVALID_RANGE);
}
UnicodeSet *s = (UnicodeSet *)fSetStack.peek();
case URX_JMPX:
loc++; // Except for extra operand on URX_JMPX, same as URX_JMP.
+ U_FALLTHROUGH;
case URX_JMP:
{
int32_t jmpDest = URX_VAL(op);
case URX_JMPX:
loc++; // URX_JMPX has an extra operand, ignored here,
// otherwise processed identically to URX_JMP.
+ U_FALLTHROUGH;
case URX_JMP:
{
int32_t jmpDest = URX_VAL(op);