Skip to main content

weir/summary/
soundness.rs

1use super::{summarize_function_with_count, OP_ID};
2
3/// Marker type for the persistent-summary dataflow primitive.
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub struct Summary;
6
7impl crate::soundness::SoundnessTagged for Summary {
8    fn soundness(&self) -> crate::soundness::Soundness {
9        crate::soundness::Soundness::MayOver
10    }
11}
12
13inventory::submit! {
14    vyre_harness::OpEntry::new(
15        OP_ID,
16        || summarize_function_with_count("ast", "cg", "cached", "out", 64),
17        Some(|| {
18            let u32s = crate::dispatch_decode::pack_u32;
19            vec![vec![
20                u32s(&[0b0001, 0]),
21                u32s(&[0b0010, 0b0100]),
22                u32s(&[0b1000, 0b1_0000]),
23                u32s(&[0, 0]),
24            ]]
25        }),
26        Some(|| {
27            let u32s = crate::dispatch_decode::pack_u32;
28            vec![vec![u32s(&[0b1011, 0b1_0100])]]
29        }),
30    )
31}