Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline tables should be immutable #131

Closed
moorereason opened this issue Jan 5, 2022 · 2 comments
Closed

Inline tables should be immutable #131

moorereason opened this issue Jan 5, 2022 · 2 comments
Assignees
Labels
bug Something isn't working implemented in v3 Fixes + features which were implemented in v3 release. TOML spec An issue relating to the library's TOML spec conformance.

Comments

@moorereason
Copy link

Environment

toml++ version and/or commit hash:
v3 b41e12f

Compiler:
gcc 11.1.0

C++ standard mode:
c++20

Target arch:
linux x86_64

Library configuration overrides:
n/a

Relevant compilation flags:
meson build_tt --buildtype=release -Dbuild_tt_encoder=true -Dbuild_tt_decoder=true -Dgenerate_cmake_config=false

Describe the bug

The following TOML document should be invalid:

a={}
[a.b]  # INVALID

The TOML spec:

Inline tables are fully self-contained and define all keys and sub-tables within them. Keys and sub-tables cannot be added outside the braces.

Steps to reproduce (or a small repro code sample)

On Linux:

$ echo "a={}\n[a.b]" | tt_decoder
{"a":{"b":{}}}

Additional information

I've submitted a PR to toml-test for this case: toml-lang/toml-test#109

Found while doing differential fuzzing against go-toml.

@moorereason moorereason added the bug Something isn't working label Jan 5, 2022
@marzer
Copy link
Owner

marzer commented Jan 5, 2022

Ah, this one is annoying. Initially this behaviour was correct, but was changed per a discussion on toml-lang/toml where others insisted I was incorrect to prohibit it. This was from before that snippet was added to the spec so I guess retroactively I was right all along hah

@marzer marzer added v3 TOML spec An issue relating to the library's TOML spec conformance. labels Jan 5, 2022
@marzer
Copy link
Owner

marzer commented Jan 5, 2022

Fixed in v3, thanks!

@marzer marzer closed this as completed Jan 5, 2022
@marzer marzer added implemented in v3 Fixes + features which were implemented in v3 release. and removed v3 labels Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working implemented in v3 Fixes + features which were implemented in v3 release. TOML spec An issue relating to the library's TOML spec conformance.
Projects
None yet
Development

No branches or pull requests

2 participants