mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-01-10 09:20:11 +00:00
feat: check line_num before converting it to int
This commit is contained in:
parent
8e589ff4d7
commit
3ca712a8da
@ -48,7 +48,11 @@ struct source_location
|
||||
{
|
||||
if(reg)
|
||||
{
|
||||
line_num_ = static_cast<std::uint_least32_t>(std::stoul(reg->line_num()));
|
||||
if(reg->line_num() != detail::region_base().line_num())
|
||||
{
|
||||
line_num_ = static_cast<std::uint_least32_t>(
|
||||
std::stoul(reg->line_num()));
|
||||
}
|
||||
column_num_ = static_cast<std::uint_least32_t>(reg->before() + 1);
|
||||
region_size_ = static_cast<std::uint_least32_t>(reg->size());
|
||||
file_name_ = reg->name();
|
||||
|
Loading…
Reference in New Issue
Block a user