-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cty: Fix panics with gob encoding of values containing numbers
We previously had a more localized workaround for this that worked only for numbers directly, but it failed to deal with the same problem in situations where the number is embedded inside some other compound type. Now we'll apply the fix recursively over the whole raw decoded data structure from gob, finding and fixing numbers inside all of the structural and collection types too. Although this fixup is mostly contained within the gob-handling functions, it does bleed slightly into the set internals because otherwise we get a chicken/egg problem where gob decoding of a set of numbers fails before we get a chance to run the fixup. The JSON and msgpack encodings of cty are the primary supported serialization formats for the standard cty type system and I'd still recommend using those instead of gob whenever possible, though as far as I know gob encoding should now work as well as it can.
- Loading branch information
1 parent
f21e35a
commit c389e93
Showing
4 changed files
with
120 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters