Fix undefined behavior when decoding varint
authorStella Lau <laus@fb.com>
Thu, 17 Aug 2017 23:34:56 +0000 (16:34 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 17 Aug 2017 23:49:51 +0000 (16:49 -0700)
commit322158b3359d2147aa81d914f31907712ec38973
tree14e436a4e95594f19f35b75ddbbd4f17ba32163a
parentbf29c7e0c2f84196519cec735c811a8c0016df85
Fix undefined behavior when decoding varint

Summary: Left shifting `0x7f` by `63` is undefined behavior (i.e. when decoding `0xFFFF...`)

Reviewed By: yfeldblum, terrelln

Differential Revision: D5653353

fbshipit-source-id: c74c9f43a9bc82d15a2223df853dc533cea1478b
folly/Varint.h
folly/test/VarintTest.cpp