aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/scope.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-02-09 14:56:51 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-02-09 14:56:51 +0200
commit68d2755a295db511ef75107d3fd82e816d4e3cb6 (patch)
tree63e28c3cc713f3c739323cc49b00e3f3d28b0621 /libbuild2/scope.hxx
parent36e62584b33b5c168b8b42564d7f45b2150eef17 (diff)
Fix issue with implicit size_t to meta_operation_id conversion
Diffstat (limited to 'libbuild2/scope.hxx')
-rw-r--r--libbuild2/scope.hxx22
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);
+ }
}
}
}