From: Ulya Trofimovich Date: Wed, 17 Feb 2016 15:01:28 +0000 (+0000) Subject: Fixed an old bug in function calculating regexp length. X-Git-Tag: 1.0~39^2~370 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=551154584ab3322b4f15f6da4ea70ebc041d8f6e;p=re2c Fixed an old bug in function calculating regexp length. The bug: the function treated 'r1 | r2' as 'r1 | r2' (used 'r1' twice instead of 'r1' and 'r2'). As the function was rarely used the bug went unnoticed for about two decades. --- diff --git a/re2c/src/ir/regexp/fixed_length.cc b/re2c/src/ir/regexp/fixed_length.cc index e0fd7e00..264737be 100644 --- a/re2c/src/ir/regexp/fixed_length.cc +++ b/re2c/src/ir/regexp/fixed_length.cc @@ -17,7 +17,7 @@ uint32_t RegExp::fixedLength () uint32_t AltOp::fixedLength () { uint32_t l1 = exp1->fixedLength (); - uint32_t l2 = exp1->fixedLength (); + uint32_t l2 = exp2->fixedLength (); if (l1 != l2 || l1 == ~0u) {