From fc9c8f63ab6435adbf8c777691180f1f1b68918f Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Mon, 18 Feb 2019 10:52:26 +0000 Subject: [PATCH] Correctly set values on main diagonal of POSIX precedence matrix (configuration compared to itself). It doesn't show any difference on the tests, probably because previously these values were set to zero, which unpacks to symmetrical (though incorrect) values, and thus doesn't affect comparison. --- re2c/src/dfa/closure_posix.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/re2c/src/dfa/closure_posix.cc b/re2c/src/dfa/closure_posix.cc index c17c1049..dcadd3bb 100644 --- a/re2c/src/dfa/closure_posix.cc +++ b/re2c/src/dfa/closure_posix.cc @@ -308,6 +308,7 @@ void orders(determ_context_t &ctx) const size_t nclos = closure.size(); prectable_t *prectbl = ctx.dc_allocator.alloct(nclos * nclos); + static const int32_t P0 = pack(MAX_RHO, 0); for (size_t i = 0; i < nclos; ++i) { for (size_t j = i + 1; j < nclos; ++j) { @@ -316,7 +317,7 @@ void orders(determ_context_t &ctx) prectbl[i * nclos + j] = pack(rho1, l); prectbl[j * nclos + i] = pack(rho2, -l); } - prectbl[i * nclos + i] = 0; + prectbl[i * nclos + i] = P0; } ctx.dc_prectbl = prectbl; -- 2.40.0