Skip to content

When examining annotations, check the value's tag.#109

Merged
zombiezen merged 1 commit into
capnproto:v3from
zenhack:fix-107
Feb 26, 2018
Merged

When examining annotations, check the value's tag.#109
zombiezen merged 1 commit into
capnproto:v3from
zenhack:fix-107

Conversation

@zenhack

@zenhack zenhack commented Feb 24, 2018

Copy link
Copy Markdown
Contributor

Otherwise, if we hit an annotation whose type is not Text, we'll panic.

Fixes #107.

@zombiezen zombiezen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! One small change, if you don't mind.

Comment thread capnpc-go/nodes.go Outdated
for i, n := 0, list.Len(); i < n; i++ {
a := list.At(i)
val, _ := a.Value()
if val.Which() != schema.Value_Which_text {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it would be more correct to inline the val.Text() method call. $notag does not have a text value.

Otherwise, if we hit an annotation whose type is not Text, we'll panic.

Fixes capnproto#107.
@zenhack

zenhack commented Feb 26, 2018 via email

Copy link
Copy Markdown
Contributor Author

@zombiezen zombiezen merged commit 62d8eb4 into capnproto:v3 Feb 26, 2018
@zenhack zenhack deleted the fix-107 branch February 26, 2018 22:00
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