fix missing block kind for null ptrs
false positive example from John Regehr
MODIFY
ir/memory.cpp
ir/memory.cpp
@@ -1631,7 +1631,6 @@ Memory::alloc(const expr &size, uint64_t align, BlockKind blockKind,
} else {
state->addAxiom(p.blockSize() == size_zext);
state->addAxiom(p.isBlockAligned(align, true));
- if (!is_null)
state->addAxiom(p.getAllocType() == alloc_ty);
if (align_bits && observesAddresses()) {

MODIFY
ir/state.cpp
ir/state.cpp
@@ -664,7 +664,7 @@ void State::addNoReturn(const expr &cond) {
return_undef_vars.insert(domain.undef_vars.begin(), domain.undef_vars.end());
if (cond.isTrue())
undef_vars.clear();
- domain.path &= !cond;
+ addUB(!cond);
}
expr State::FnCallInput::operator==(const FnCallInput &rhs) const {

ADD
tests/alive-tv/memory/nullptr-call.srctgt.ll
+define ptr @src(i1 %arg) {
+bb:
+ %tmp = alloca i64, align 8
+ br i1 %arg, label %bb2, label %bb6
+
+bb2:
+ %tmp3 = call ptr @f(ptr %tmp)
+ switch i1 false, label %bb8 [
+ i1 true, label %bb6
+ ]
+
+bb6:
+ %tmp7 = phi ptr [ null, %bb ], [ %tmp3, %bb2 ]
+ ret ptr %tmp7
+
+bb8:
+ unreachable
+}
+
+define ptr @tgt(i1 %arg) {
+bb:
+ %tmp = alloca i64, align 8
+ br i1 %arg, label %bb2, label %bb6
+
+bb2:
+ %tmp3 = call ptr @f(ptr %tmp)
+ br label %bb6
+
+bb6:
+ %tmp7 = phi ptr [ null, %bb ], [ %tmp3, %bb2 ]
+ ret ptr %tmp7
+}
+
+declare ptr @f(ptr)

fix missing block kind for null ptrs
false positive example from John Regehr