MCPcopy Create free account
hub / github.com/AliveToolkit/alive2 / isInboundsOf

Method isInboundsOf

ir/pointer.cpp:418–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416}
417
418expr 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
436expr Pointer::isInbounds(bool strict) const {
437 auto offset = getOffsetSizet();

Callers 1

isDereferenceableMethod · 0.80

Calls 11

getOffsetMethod · 0.80
getLogAddressMethod · 0.80
blockSizeAlignedMethod · 0.80
ugtMethod · 0.80
ugeMethod · 0.80
add_no_uoverflowMethod · 0.80
uleMethod · 0.80
isZeroMethod · 0.45
zextOrTruncMethod · 0.45
eqMethod · 0.45
isTrueMethod · 0.45

Tested by

no test coverage detected