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

Method isStackAllocated

ir/pointer.cpp:760–767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

758}
759
760expr Pointer::isStackAllocated(bool simplify) const {
761 // 1) if a stack object is returned by a callee it's UB
762 // 2) if a stack object is given as argument by the caller, we can upgrade it
763 // to a global object, so we can do POR here.
764 if (simplify && (!has_alloca || isLocal().isFalse()))
765 return false;
766 return getAllocType() == STACK;
767}
768
769expr Pointer::isHeapAllocated() const {
770 assert(MALLOC == 2 && CXX_NEW == 3);

Callers 3

mkInputMethod · 0.80
encodePtrAttrsFunction · 0.80
checkMethod · 0.80

Calls 1

isFalseMethod · 0.80

Tested by

no test coverage detected