-
Notifications
You must be signed in to change notification settings - Fork 664
Conversation
@@ -48,7 +48,7 @@ fn generate_module(name: &'static str, entries: &mut Vec<String>) -> Result<()> | |||
let rule_name = format_ident!("{}", rule_name); | |||
|
|||
rules.insert( | |||
index, | |||
index.min(rules.len()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The index
may be out of bounds of rules
vector. Because index
is the binary search result of entries, which length is always greater equal to the rules's. So we need to use index.min(rules.len()
to avoid out of bounds insertion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is due to the entries
vector now being shared between analyzers
and semantic_analyzers
, I have a proper fix for this ready as part of the refactor adding rule groups
Don't merge for now, the current implementation is not efficient, I will optimize it. |
This could be merged once #2841 is merged. |
Done. |
NIce. |
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Summary
Test Plan