fix crash in float->BV conversions
MODIFY
ir/type.cpp
ir/type.cpp
@@ -575,11 +575,14 @@ StateValue AggregateType::aggregateVals(const vector<StateValue> &vals) const {
}
StateValue AggregateType::extract(const StateValue &val, unsigned index) const {
+ if (!val.isValid())
+ return {};
+
unsigned total_till_now = 0;
for (unsigned i = 0; i < index; ++i) {
total_till_now += children[i]->bits();
}
- unsigned high = val.value.bits() - total_till_now;
+ unsigned high = val.bits() - total_till_now;
unsigned h = high - 1;
unsigned l = high - children[index]->bits();

MODIFY
smt/expr.cpp
smt/expr.cpp
@@ -1173,7 +1173,8 @@ expr expr::toBVBool() const {
}
expr expr::float2BV() const {
- if (auto app = isAppOf(Z3_OP_FPA_TO_FP))
+ if (auto app = isAppOf(Z3_OP_FPA_TO_FP)) // ((_ to_fp e s) BV)
+ if (Z3_get_app_num_args(ctx(), app) == 1)
return Z3_get_app_arg(ctx(), app, 0);
return unop_fold(Z3_mk_fpa_to_ieee_bv);

fix crash in float->BV conversions