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

Function at_least_same_offseting

ir/pointer.cpp:774–796  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

772}
773
774static expr at_least_same_offseting(const Pointer &p1, const Pointer &p2,
775 bool any_stack) {
776 expr size = p1.blockSizeOffsetT();
777 expr off = p1.getOffsetSizet();
778 expr size2 = p2.blockSizeOffsetT();
779 expr off2 = p2.getOffsetSizet();
780 return
781 expr::mkIf(p1.isHeapAllocated(),
782 p1.getAllocType() == p2.getAllocType() &&
783 off == off2 && size == size2,
784
785 any_stack
786 ? expr(true)
787 :expr::mkIf(off.sge(0),
788 off2.sge(0) &&
789 expr::mkIf(off.ule(size),
790 off2.ule(size2) && off2.uge(off) &&
791 (size2 - off2).uge(size - off),
792 off2.ugt(size2) && off == off2 &&
793 size2.uge(size)),
794 // maintains same dereferenceability before/after
795 off == off2 && size2.uge(size)));
796}
797
798expr Pointer::refined(const Pointer &other) const {
799 bool is_asm = other.m.isAsmMode();

Callers 2

refinedMethod · 0.85
fninputRefinedMethod · 0.85

Calls 9

blockSizeOffsetTMethod · 0.80
getOffsetSizetMethod · 0.80
isHeapAllocatedMethod · 0.80
getAllocTypeMethod · 0.80
sgeMethod · 0.80
uleMethod · 0.80
ugeMethod · 0.80
ugtMethod · 0.80
exprClass · 0.70

Tested by

no test coverage detected