Skip to content

Conversation

zielmicha
Copy link
Contributor

Generated using "git status --porcelain" on Linux - all these files are executables.

@zielmicha
Copy link
Contributor Author

Whoever feels imperiously: is it going to be merged? If not, please close this issue, so it won't clobber list. (And mind that this option is better than others in at least one way: it's already ready).

gradha added a commit that referenced this pull request Dec 17, 2013
Expand gitignore to include all binaries built by ./koch test.
@gradha gradha merged commit bc95cc4 into nim-lang:master Dec 17, 2013
reactormonk pushed a commit to reactormonk/nim that referenced this pull request Apr 7, 2014
Expand gitignore to include all binaries built by ./koch test.
Clyybber pushed a commit to Clyybber/Nim that referenced this pull request Sep 16, 2023
## Summary

Unmarshaling a `Table` or `OrderedTable` where the key is a `cstring`
via `fromJsonHook` cannot be implemented to work in a safe way, at
least when using the C backend. For this reason, the overload is
removed.

## Details

The reason that it cannot work for the C target, is that `cstring`s
are unsafe views into strings there, so the keys of the table can,
in theory, only be valid for as long as the source `JsonNode` is
alive (and unchanged).

In practice, due to the iterators used by `fromJsonHook` not using
`lent` and thus introducing temporary copies, the `cstring` keys were
only valid for the loop iteration in which they were added to the
table.

The test case that existed for `OrderedTable[cstring, int]` only worked
by accident. Changing the allocation behaviour, building with
`-d:useMalloc`, or enabling memory sanitizers would all result in
test failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants