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

Method max_value

src/analysis/memory/expression.rs:488–506  ·  view source on GitHub ↗

Returns the maximum value for this type, as a ConstantValue element. If the type is not a primitive value, the result is Bottom.

(&self)

Source from the content-addressed store, hash-verified

486 /// Returns the maximum value for this type, as a ConstantValue element.
487 /// If the type is not a primitive value, the result is Bottom.
488 pub fn max_value(&self) -> ConstantValue {
489 use self::ExpressionType::*;
490 match self {
491 Bool => ConstantValue::Int(Integer::from(1)),
492 I8 => ConstantValue::Int(Integer::from(std::i8::MAX)),
493 I16 => ConstantValue::Int(Integer::from(std::i16::MAX)),
494 I32 => ConstantValue::Int(Integer::from(std::i32::MAX)),
495 I64 => ConstantValue::Int(Integer::from(std::i64::MAX)),
496 I128 => ConstantValue::Int(Integer::from(std::i128::MAX)),
497 Isize => ConstantValue::Int(Integer::from(std::isize::MAX)),
498 U8 => ConstantValue::Int(Integer::from(std::u8::MAX)),
499 U16 => ConstantValue::Int(Integer::from(std::u16::MAX)),
500 U32 => ConstantValue::Int(Integer::from(std::u32::MAX)),
501 U64 => ConstantValue::Int(Integer::from(std::u64::MAX)),
502 U128 => ConstantValue::Int(Integer::from(std::u128::MAX)),
503 Usize => ConstantValue::Int(Integer::from(std::usize::MAX)),
504 _ => ConstantValue::Bottom,
505 }
506 }
507
508 pub fn max_value_int(&self) -> Integer {
509 use self::ExpressionType::*;

Callers 2

castMethod · 0.80
handle_checked_addMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected