You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating a file stream for file that doesn't exist results in stream object whose fail() method returns true. json::parse never returns when called on such a stream. Adding a check for m_stream.fail() (in addition to eof()) in fill_line_buffer seems to do the trick, invalid_argument exception gets thrown. Not sure if this is the right fix, it might also make sense checking that stream isn't 'bad' (not sure what causes this to happen as bad() for missing file stream returns false).
The text was updated successfully, but these errors were encountered:
Thanks for reporting. I encountered the bug before, but never bothered to fix it... Commit 4bb41d0 adds a check in the lexer's constructor to immediately abort if the passed stream is fail()ed.
Haven't had the chance to try and won't be able in some time. I did have a look at your fix (and test) and it looks like it'll fix the issue so I'll close the bug. Thanks for the quick response.
Creating a file stream for file that doesn't exist results in stream object whose fail() method returns true. json::parse never returns when called on such a stream. Adding a check for m_stream.fail() (in addition to eof()) in fill_line_buffer seems to do the trick, invalid_argument exception gets thrown. Not sure if this is the right fix, it might also make sense checking that stream isn't 'bad' (not sure what causes this to happen as bad() for missing file stream returns false).
The text was updated successfully, but these errors were encountered: