mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 02:08:09 +08:00
fix: parse_literal_string() properly issues invalid-utf8 errors
When creating the inner iterator, make sure it points into the same vector as the outer iterator. Otherwise, attempts to reset the iterator wind up causing it to read out-of-bounds. Fixes #199.
This commit is contained in:
@@ -664,7 +664,8 @@ parse_literal_string(location& loc)
|
||||
const auto first = loc.iter();
|
||||
if(const auto token = lex_literal_string::invoke(loc))
|
||||
{
|
||||
location inner_loc(loc.name(), token.unwrap().str());
|
||||
auto inner_loc = loc;
|
||||
inner_loc.reset(first);
|
||||
|
||||
const auto open = lex_apostrophe::invoke(inner_loc);
|
||||
if(!open)
|
||||
|
Reference in New Issue
Block a user