added a helper function to make it easier to identify issue 230 at different execution points.
This commit is contained in:
parent
3fed057513
commit
cd2e559efd
15
src/Issue230Helpers.h
Normal file
15
src/Issue230Helpers.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
template<typename MType,typename MValue>
|
||||||
|
bool isIssue230(MType& m_type, MValue& m_value){
|
||||||
|
if(m_value.number_float != 23.42)
|
||||||
|
return false;
|
||||||
|
if(m_type.bits.exp_cap == 0 and
|
||||||
|
m_type.bits.exp_plus == 0 and
|
||||||
|
m_type.bits.has_exp == 1 and
|
||||||
|
m_type.bits.parsed == 1 and
|
||||||
|
m_type.bits.precision == 0 and
|
||||||
|
m_type.bits.type == 7)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
11
src/json.hpp
11
src/json.hpp
@ -52,6 +52,7 @@ SOFTWARE.
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "Issue230Helpers.h"
|
||||||
|
|
||||||
// disable float-equal warnings on GCC/clang
|
// disable float-equal warnings on GCC/clang
|
||||||
#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
|
#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
|
||||||
@ -6297,8 +6298,16 @@ class basic_json
|
|||||||
std::stringstream applesauce;
|
std::stringstream applesauce;
|
||||||
applesauce << o.rdbuf();
|
applesauce << o.rdbuf();
|
||||||
std::string s2 = applesauce.str();
|
std::string s2 = applesauce.str();
|
||||||
if(s2.compare("2e01") == 0)
|
if(isIssue230(m_type,m_value)) {
|
||||||
|
printf("m_type.bits.exp_cap = %i \n",m_type.bits.exp_cap);
|
||||||
|
printf("m_type.bits.exp_plus = %i \n",m_type.bits.exp_plus);
|
||||||
|
printf("m_type.bits.has_exp = %i \n",m_type.bits.has_exp);
|
||||||
|
printf("m_type.bits.parsed = %i \n",m_type.bits.parsed);
|
||||||
|
printf("m_type.bits.precision = %i \n",m_type.bits.precision);
|
||||||
|
printf("m_type.bits.type = %i \n",m_type.bits.type);
|
||||||
|
printf("m_value = %f\n",m_value.number_float);
|
||||||
throw std::logic_error("found it");
|
throw std::logic_error("found it");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user