fix regression in null fn argument refinement
fixes failures in CallSiteSplitting
MODIFY
ir/pointer.cpp
ir/pointer.cpp
@@ -506,8 +506,9 @@ expr Pointer::fninputRefined(const Pointer &other, set<expr> &undef,
// TODO: this induces an infinite loop
// block_refined(other);
- return expr::mkIf(isLocal(), local, *this == other) &&
- isBlockAlive().implies(other.isBlockAlive());
+ return expr::mkIf(isNull(), other.isNull(),
+ expr::mkIf(isLocal(), local, *this == other) &&
+ isBlockAlive().implies(other.isBlockAlive()));
}
expr Pointer::isWritable() const {

ADD
tests/alive-tv/calls/null-refine.srctgt.ll
+define void @src(i8* %p) {
+ %c = icmp eq i8* %p, null
+ br i1 %c, label %then, label %else
+
+then:
+ br label %exit
+
+else:
+ br label %exit
+
+exit:
+ call void @f(i8* %p)
+ ret void
+}
+
+define void @tgt(i8* %p) {
+ %c = icmp eq i8* %p, null
+ br i1 %c, label %then, label %else
+
+then:
+ call void @f(i8* null)
+ ret void
+
+else:
+ call void @f(i8* %p)
+ ret void
+}
+
+declare void @f(i8*)

fix regression in null fn argument refinement
fixes failures in CallSiteSplitting