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

Infinite iteration in _AddListFieldsMethod when serializing nested messages #9

Open
mrgonza78 opened this issue Nov 29, 2016 · 0 comments

Comments

@mrgonza78
Copy link

mrgonza78 commented Nov 29, 2016

// issue.proto
syntax = "proto2";

message Qux {
  optional uint32 waldo = 1;
}

message Bar {
  optional Qux qux = 1;
}

message Foo {
  optional Bar bar = 1;
}
issue_pb = require('issue_pb')
foo = issue_pb.Foo()
foo.bar.qux.waldo = 1
foo:SerializeToString()

SerializeToString loops infinitely at _AddListFieldsMethod.

The problem seems to be that bar. _is_present_in_parent is false b/c bar.SetInParent is never called (may be?)

If I manually call bar.SetInParent, then it just works

issue_pb = require('issue_pb')
foo = issue_pb.Foo()
foo.bar.qux.waldo = 1
bar:SetInParent()
foo:SerializeToString() -- Now it works, I get the string
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

No branches or pull requests

1 participant