MCPcopy Create free account
hub / github.com/Rust-API/Rust-API-Bypass-Checker / bitor

Method bitor

src/analysis/numerical/interval.rs:445–462  ·  view source on GitHub ↗
(self, rhs: Self)

Source from the content-addressed store, hash-verified

443 type Output = Self;
444
445 fn bitor(self, rhs: Self) -> Self::Output {
446 if self.is_bottom() || rhs.is_bottom() {
447 Self::bottom()
448 } else if self.is_top() || rhs.is_top() {
449 Self::top()
450 } else if self.all_ones() || rhs.all_ones() {
451 Self::new(Bound::from(-1i128), Bound::from(-1i128))
452 } else if self.is_zero() {
453 rhs
454 } else if rhs.is_zero() {
455 self
456 } else if let (Ok(lval), Ok(rval)) = (Integer::try_from(self), Integer::try_from(rhs)) {
457 let or_val = lval | rval;
458 Self::new(Bound::from(or_val.clone()), Bound::from(or_val))
459 } else {
460 Self::top()
461 }
462 }
463}
464
465impl BitXor for Interval {

Callers

nothing calls this directly

Calls 4

all_onesMethod · 0.80
is_bottomMethod · 0.45
is_topMethod · 0.45
is_zeroMethod · 0.45

Tested by

no test coverage detected