diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-15 20:33:15 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-15 20:33:15 +0800 |
| commit | 904f78d506240516ace2305e570d542c3b18440f (patch) | |
| tree | 5fe7b5521b6393722d7ac3372240b78f6ba27ec3 | |
| parent | 2c66376a50d767e6e2e0bc5233707a39f124607b (diff) | |
fix(mingling_picker): correct mask size and arg index in tag phase
Previously, the mask was sized by the template param `$` and
arg indexing used `$-`, causing incorrect results when the
actual number of arguments differed from the macro expansion
count.
| -rw-r--r-- | mingling_picker/src/picker/parse.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mingling_picker/src/picker/parse.rs b/mingling_picker/src/picker/parse.rs index 744254d..ac4b30e 100644 --- a/mingling_picker/src/picker/parse.rs +++ b/mingling_picker/src/picker/parse.rs @@ -96,7 +96,7 @@ internal_repeat!(1..=32 => { // Tag Func Box::new(|args, mask| { let ctx = TagPhaseContext { - arg_info: &arg_infos[$], + arg_info: &arg_infos[$-], args, mask }; @@ -145,8 +145,8 @@ internal_repeat!(1..=32 => { // Sort by Bundle Ord (descending) bundle.sort_by(|a, b| b.0.cmp(&a.0)); - // Mask - let mut mask: Vec<u8> = vec![0u8; $]; + // Mask — size = number of args (not flags), so use args length + let mut mask: Vec<u8> = vec![0u8; self.args.len()]; // Parsing for (_, tag_func, pick_func, _idx) in bundle { |
