Fix bug in ULEB128 decoding (#2195)

This commit is contained in:
Peter Johnson
2019-12-24 14:12:42 -06:00
committed by GitHub
parent bdc1cab013
commit 0c6f24562f

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */
/* Copyright (c) 2015-2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -38,7 +38,7 @@ uint64_t WriteUleb128(SmallVectorImpl<char>& dest, uint64_t val) {
}
uint64_t ReadUleb128(const char* addr, uint64_t* ret) {
uint32_t result = 0;
uint64_t result = 0;
int shift = 0;
size_t count = 0;
@@ -59,7 +59,7 @@ uint64_t ReadUleb128(const char* addr, uint64_t* ret) {
}
bool ReadUleb128(raw_istream& is, uint64_t* ret) {
uint32_t result = 0;
uint64_t result = 0;
int shift = 0;
while (1) {