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

Method isOfBlock

ir/pointer.cpp:402–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402expr Pointer::isOfBlock(const Pointer &block, const expr &bytes,
403 bool is_phy) const {
404 assert(block.getOffset().isZero());
405 expr addr = is_phy ? getPhysicalAddress() : getAddress();
406 expr block_addr = block.getLogAddress();
407 expr block_size = block.blockSizeAlignedOffsetT();
408
409 if (bytes.eq(block_size))
410 return addr == block_addr;
411 if (bytes.ugt(block_size).isTrue())
412 return false;
413
414 return addr.uge(block_addr) &&
415 addr.ult(block_addr + block_size.zextOrTrunc(bits_ptr_address));
416}
417
418expr Pointer::isInboundsOf(const Pointer &block, const expr &bytes0,
419 bool is_phy) const {

Callers 1

isDereferenceableMethod · 0.80

Calls 10

getOffsetMethod · 0.80
getLogAddressMethod · 0.80
ugtMethod · 0.80
ugeMethod · 0.80
ultMethod · 0.80
isZeroMethod · 0.45
eqMethod · 0.45
isTrueMethod · 0.45
zextOrTruncMethod · 0.45

Tested by

no test coverage detected