-
Notifications
You must be signed in to change notification settings - Fork 4
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
erlcapnp cheats when encoding lists of text fields #3
Comments
bucko909
changed the title
erlcapnp cheats when enoding lists of text fields
erlcapnp cheats when encoding lists of text fields
Jan 25, 2018
bucko909
added a commit
that referenced
this issue
Apr 8, 2021
Without this, a `List(Text)` (which is `List(List(Int8))`) which is not encodeded as `List(struct { x @0 :Text; })`, will decode the first text pointer as a tag and get very wrong answers. The patch: * Makes sure we give a sensible error for unsupported types. * Provides better checking that data is correctly formatted. * Also adds support for decoding `List(Text)` correctly, as well as decoding `List(struct {})` which was upgraded from `List(Int64)` or `List(AnyPointer)` (or compatible types). We still don't support double lists. This relates to Issue #3 (which relies on the upgrade decoding for its `List(Text)` encoding to be valid).
bucko909
added a commit
that referenced
this issue
Apr 8, 2021
Without this, a `List(Text)` (which is `List(List(Int8))`) which is not encodeded as `List(struct { x @0 :Text; })`, will decode the first text pointer as a tag and get very wrong answers. The patch: * Makes sure we give a sensible error for unsupported types. * Provides better checking that data is correctly formatted. * Also adds support for decoding `List(Text)` correctly, as well as decoding `List(struct {})` which was upgraded from `List(Int64)` or `List(AnyPointer)` (or compatible types). We still don't support double lists. This relates to Issue #3 (which relies on the upgrade decoding for its `List(Text)` encoding to be valid).
bucko909
added a commit
that referenced
this issue
Apr 8, 2021
Without this, a `List(Text)` (which is `List(List(Int8))`) which is not encodeded as `List(struct { x @0 :Text; })`, will decode the first text pointer as a tag and get very wrong answers. The patch: * Makes sure we give a sensible error for unsupported types. * Provides better checking that data is correctly formatted. * Also adds support for decoding `List(Text)` correctly, as well as decoding `List(struct {})` which was upgraded from `List(Int64)` or `List(AnyPointer)` (or compatible types). We still don't support double lists. This relates to Issue #3 (which relies on the upgrade decoding for its `List(Text)` encoding to be valid).
bucko909
added a commit
that referenced
this issue
Apr 9, 2021
Without this, a `List(Text)` (which is `List(List(Int8))`) which is not encodeded as `List(struct { x @0 :Text; })`, will decode the first text pointer as a tag and get very wrong answers. The patch: * Makes sure we give a sensible error for unsupported types. * Provides better checking that data is correctly formatted. * Also adds support for decoding `List(Text)` correctly, as well as decoding `List(struct {})` which was upgraded from `List(Int64)` or `List(AnyPointer)` (or compatible types). We still don't support double lists. This relates to Issue #3 (which relies on the upgrade decoding for its `List(Text)` encoding to be valid).
bucko909
added a commit
that referenced
this issue
Apr 12, 2021
Without this, a `List(Text)` (which is `List(List(Int8))`) which is not encodeded as `List(struct { x @0 :Text; })`, will decode the first text pointer as a tag and get very wrong answers. The patch: * Makes sure we give a sensible error for unsupported types. * Provides better checking that data is correctly formatted. * Also adds support for decoding `List(Text)` correctly, as well as decoding `List(struct {})` which was upgraded from `List(Int64)` or `List(AnyPointer)` (or compatible types). We still don't support double lists. This relates to Issue #3 (which relies on the upgrade decoding for its `List(Text)` encoding to be valid).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This instructs to use
ast_encode_struct_list_/3
to encode the text list.Should really have an
ast_encode_ptr_list_/1
which takesEncodeFun
only.That function should be functionally identical except that:
StructLen
is 1 (each element of the list is just a single pointer).There should also be a test to make sure this works.
The text was updated successfully, but these errors were encountered: