fix crash in float const constructor
MODIFY
ir/constant.cpp
ir/constant.cpp
@@ -81,8 +81,8 @@ static string int_to_readable_float(Type &type, const string &val) {
}
FloatConst::FloatConst(Type &type, string val, bool bit_value)
- : Constant(type, int_to_readable_float(type, val)), val(std::move(val)),
- bit_value(bit_value) {}
+ : Constant(type, bit_value ? int_to_readable_float(type, val) : val),
+ val(std::move(val)), bit_value(bit_value) {}
expr FloatConst::getTypeConstraints() const {
return Value::getTypeConstraints() &&

fix crash in float const constructor