fix assertion crash due to missing non_poison simplification in State::operator[]
MODIFY
ir/state.cpp
ir/state.cpp
@@ -440,7 +440,7 @@ const StateValue& State::operator[](const Value &val) {
auto sval_new = sval.subst(repls);
if (sval_new.eq(sval)) {
uvars.clear();
- return sval;
+ return simplify(sval, true);
}
for (auto &p : repls) {

ADD
tests/alive-tv/poison-double.srctgt.ll
+define i8 @src(i8 %a, ptr %p) {
+ %d = load i8, ptr %p
+ %x = udiv i8 %a, %d
+ %y = udiv i8 %a, %d
+ %z = add i8 %x, %y
+ ret i8 %z
+}
+
+define i8 @tgt(i8 %a, ptr %p) {
+ %d = load i8, ptr %p
+ %x = udiv i8 %a, %d
+ %z = add i8 %x, %x
+ ret i8 %z
+}

fix assertion crash due to missing non_poison simplification in State::operator[]