SIM_VALUE stores significants in 64-bit
stol isn't neccesarily 64-bit though, so we use stoll and catch the overflow if we have bad input data Fixes KICAD-2EF
This commit is contained in:
parent
5b42348834
commit
7779a01d48
|
@ -163,11 +163,18 @@ static inline void handleNodeForParse( tao::pegtl::parse_tree::node& aNode,
|
|||
aParseResult.isEmpty = false;
|
||||
|
||||
for( const auto& subnode : aNode.children )
|
||||
{
|
||||
try
|
||||
{
|
||||
if( subnode->is_type<SIM_VALUE_PARSER::intPart>() )
|
||||
aParseResult.intPart = std::stol( subnode->string() );
|
||||
aParseResult.intPart = std::stoll( subnode->string() );
|
||||
else if( subnode->is_type<SIM_VALUE_PARSER::fracPart>() )
|
||||
aParseResult.fracPart = std::stol( subnode->string() );
|
||||
aParseResult.fracPart = std::stoll( subnode->string() );
|
||||
}
|
||||
catch( const std::exception& )
|
||||
{
|
||||
aParseResult.isOk = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( aNode.is_type<SIM_VALUE_PARSER::exponent>() )
|
||||
|
|
Loading…
Reference in New Issue