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

Method free

ir/memory.cpp:2250–2266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2248}
2249
2250void Memory::free(const expr &ptr, bool unconstrained) {
2251 assert(!memory_unused());
2252 Pointer p(*this, ptr);
2253 expr isnnull = p.isNull();
2254
2255 if (!unconstrained)
2256 state->addUB(isnnull || (p.getOffset() == 0 &&
2257 p.isBlockAlive() &&
2258 p.getAllocType() == Pointer::MALLOC));
2259
2260 if (!isnnull.isTrue()) {
2261 // A nonlocal block for encoding fn calls' side effects cannot be freed.
2262 ensure_non_fncallmem(p);
2263 store_bv(p, false, local_block_liveness, non_local_block_liveness, false,
2264 !isnnull);
2265 }
2266}
2267
2268unsigned Memory::getStoreByteSize(const Type &ty) {
2269 assert(bits_program_pointer != 0);

Callers 1

toSMTMethod · 0.80

Calls 9

memory_unusedFunction · 0.85
ensure_non_fncallmemFunction · 0.85
store_bvFunction · 0.85
isNullMethod · 0.80
addUBMethod · 0.80
getOffsetMethod · 0.80
getAllocTypeMethod · 0.80
isBlockAliveMethod · 0.45
isTrueMethod · 0.45

Tested by

no test coverage detected