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

error in _AddSetListenerMethod (protobuf.lua line:592) #31

Open
bebezhang opened this issue Apr 28, 2017 · 2 comments
Open

error in _AddSetListenerMethod (protobuf.lua line:592) #31

bebezhang opened this issue Apr 28, 2017 · 2 comments

Comments

@bebezhang
Copy link

image
line 592 should use ” if listener = nil then‘’ instead?

@islet8
Copy link

islet8 commented Jul 14, 2017

Yes, it should be "if listener == nil then".

@nnnjkk
Copy link

nnnjkk commented Jun 27, 2019

Yes. And if not fixed, it'll cause bugs:

  1. when the .proto file is:
    message A { message B { message C { required uint32 d = 1; } optional C c = 1; } required B b = 1; }
    Endless Loop, when printing an object of Message A.
    Runtime Error, when serializing an object of Message A.
  2. when the .proto file is:
    message A { message B { message C { required uint32 d = 1; } required C c = 1; } optional B b = 1; }
    Endless Loop, when serializing an object of Message A.
  3. when the .proto file is:
    message A { message B { message C { required uint32 d = 1; } required C c = 1; } repeated B b = 1; }
    OK, when printing or serializing an object of Message A.
    But, the result of serializing is wrong -- the 2nd Byte is '0x00', while it should be the '0x04', that is the length of a packed Message B.
    So, it'll be failed or get wrong data when parsing the result of serializing.

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

3 participants