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

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

Merged
merged 1 commit into from
Feb 26, 2018

Conversation

zenhack
Copy link
Contributor

@zenhack zenhack commented Feb 24, 2018

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

Fixes #107.

Copy link
Contributor

@zombiezen zombiezen left a comment

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.

@@ -161,6 +161,10 @@ func parseAnnotations(list schema.Annotation_List) *annotations {
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
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
Copy link
Contributor Author

zenhack commented Feb 26, 2018 via email

@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.

None yet

2 participants