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

wire_type seems to be incorrectly used in writeproto? #196

Closed
findmyway opened this issue Feb 23, 2022 · 0 comments
Closed

wire_type seems to be incorrectly used in writeproto? #196

findmyway opened this issue Feb 23, 2022 · 0 comments

Comments

@findmyway
Copy link
Contributor

ProtoBuf.jl/src/codec.jl

Lines 303 to 310 in a0a8396

function writeproto(io::IO, val::T, attrib::ProtoMetaAttribs) where T<:ConcreteTypes
fldnum = attrib.fldnum
n = 0
n += _write_key(io, fldnum, wire_type(typeof(val)))
n += _write_value(io, val)
n
end

Here, wire_type(typeof(val)) doesn't consider attrib. So for a field of fixed64, the val type is UInt64 and the the wire_type is always VARINT?

wire_type(::Type{FixedSizeNumber{UInt64}}) = WIRETYP_64BIT

I guess it should call the above one instead in this case?


The error is first found in oolong-dev/OpenTelemetry.jl#64

findmyway added a commit to findmyway/ProtoBuf.jl that referenced this issue Feb 24, 2022
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 a pull request may close this issue.

1 participant