| 416 | } |
| 417 | |
| 418 | expr Pointer::isInboundsOf(const Pointer &block, const expr &bytes0, |
| 419 | bool is_phy) const { |
| 420 | assert(block.getOffset().isZero()); |
| 421 | expr bytes = bytes0.zextOrTrunc(bits_ptr_address); |
| 422 | expr addr = is_phy ? getPhysicalAddress() : getAddress(); |
| 423 | expr block_addr = block.getLogAddress(); |
| 424 | expr block_size = block.blockSizeAligned().zextOrTrunc(bits_ptr_address); |
| 425 | |
| 426 | if (bytes.eq(block_size)) |
| 427 | return addr == block_addr; |
| 428 | if (bytes.ugt(block_size).isTrue()) |
| 429 | return false; |
| 430 | |
| 431 | return addr.uge(block_addr) && |
| 432 | addr.add_no_uoverflow(bytes) && |
| 433 | (addr + bytes).ule(block_addr + block_size); |
| 434 | } |
| 435 | |
| 436 | expr Pointer::isInbounds(bool strict) const { |
| 437 | auto offset = getOffsetSizet(); |
no test coverage detected