When overriding rules, ensure that the sources match

In places where a second rule definition might replace, append to, or
replace items from a base rule, ensure that the source of the second
rule definiton matches the first.

This already existed for defines, but for other changes. There was a
bug where a second definition might exist for a different source, but
the additional rule was used anyway.

This now returns the same error for these other changes e.g. "Rule has
been re-defined..." as define.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
This commit is contained in:
Mark Stemm
2024-10-16 13:45:21 -07:00
committed by poiana
parent a44b311333
commit 4a73ef8824
2 changed files with 20 additions and 6 deletions

View File

@@ -97,6 +97,9 @@ public:
virtual void selective_replace(configuration& cfg, rule_update_info& info);
private:
template<typename ruleInfo>
rule_info* find_prev_rule(ruleInfo& info);
uint32_t m_cur_index;
indexed_vector<rule_info> m_rule_infos;
indexed_vector<macro_info> m_macro_infos;