diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-02-09 14:56:51 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-02-09 14:56:51 +0200 |
commit | 68d2755a295db511ef75107d3fd82e816d4e3cb6 (patch) | |
tree | 63e28c3cc713f3c739323cc49b00e3f3d28b0621 | |
parent | 36e62584b33b5c168b8b42564d7f45b2150eef17 (diff) |
Fix issue with implicit size_t to meta_operation_id conversion
-rw-r--r-- | libbuild2/scope.hxx | 22 |
1 files 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<T> (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<meta_operation_id> (i); + + if (mid != noop_id && + mid != info_id && + mid != create_id && + mid != disfigure_id) + rules.insert<T> (mid, oid, hint, r); + } } } } |