提交 f9722af3 编写于 作者: M Megvii Engine Team

fix(src/json): fix parsing error when inf is dumped as a Number

GitOrigin-RevId: 62cfba48c00449a8709525e0131564bd6e85b1f8
上级 16678bb9
......@@ -52,6 +52,14 @@ void Value::writeto_fpath(const char* fout_path, int indent) const {
}
void Number::writeto(std::string& fout, int) const {
if (std::isinf(m_val)){
fout += "\"inf\"";
return ;
}
if (std::isnan(m_val)){
fout += "\"nan\"";
return ;
}
static char fmt[16];
static Spinlock fmt_mtx;
if (!fmt[sizeof(fmt) - 1]) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册