-
-
Notifications
You must be signed in to change notification settings - Fork 185
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
TOML++ version 3.2.0
Compiler:
GCC 10
C++ standard mode:
C++ 17
Library configuration overrides:
TOML_ENABLE_FORMATTERS 0
TOML_EXCEPTIONS 0
Describe the bug
Assert in unique_ptr::operator*
Steps to reproduce (or a small repro code sample)
Use value in TOML whih does not parse, like
[a]
b = [c"]
Additional information
parser::parse_array()callsarray::emplace_back()even ifparse_value()failsarray::emplace_back()doesinsert_at_back()andreturn *elems_.back();- which is dereferencing nullptr.- dereferencing nullptr is undefined behavior - MSVC lets it pass, but GCC (libstdcpp) has proper assert.
The simplest fix probably would be something like 4a4bf1e. I didn't do PR because I would expect that some of the tests running on GCC already found the problem.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working