From 68d2755a295db511ef75107d3fd82e816d4e3cb6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 9 Feb 2022 14:56:51 +0200 Subject: Fix issue with implicit size_t to meta_operation_id conversion --- libbuild2/scope.hxx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/libbuild2/scope.hxx b/libbuild2/scope.hxx index e3ebdef..2df8f0a 100644 --- a/libbuild2/scope.hxx +++ b/libbuild2/scope.hxx @@ -443,15 +443,19 @@ namespace build2 for (size_t i (1), n (ms.size ()); i != n; ++i) { - // Skip a few well-known meta-operations that cannot possibly - // trigger a rule match. - // - if (ms[i] != nullptr && - i != noop_id && - i != info_id && - i != create_id && - i != disfigure_id) - rules.insert (i, oid, hint, r); + if (ms[i] != nullptr) + { + // Skip a few well-known meta-operations that cannot possibly + // trigger a rule match. + // + mid = static_cast (i); + + if (mid != noop_id && + mid != info_id && + mid != create_id && + mid != disfigure_id) + rules.insert (mid, oid, hint, r); + } } } } -- cgit v1.1