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

Method bitand

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

Source from the content-addressed store, hash-verified

420 type Output = Self;
421
422 fn bitand(self, rhs: Self) -> Self::Output {
423 if self.is_bottom() || rhs.is_bottom() {
424 Self::bottom()
425 } else if self.is_top() || rhs.is_top() {
426 Self::top()
427 } else if self.is_zero() || rhs.is_zero() {
428 Self::new(Bound::from(0u128), Bound::from(0u128))
429 } else if self.all_ones() {
430 rhs
431 } else if rhs.all_ones() {
432 self
433 } else if let (Ok(lval), Ok(rval)) = (Integer::try_from(self), Integer::try_from(rhs)) {
434 let and_val = lval & rval;
435 Self::new(Bound::from(and_val.clone()), Bound::from(and_val))
436 } else {
437 Self::top()
438 }
439 }
440}
441
442impl BitOr 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