protobuf: fix safe int check.
This commit is contained in:
parent
0b24daba31
commit
765c3d2b77
@ -200,7 +200,6 @@ exports.readVarint = function readVarint(data, off) {
|
||||
break;
|
||||
}
|
||||
ch = data[off++];
|
||||
assert(size + 1 < 6, 'Number exceeds 2^53-1.');
|
||||
// Optimization for javascript insanity.
|
||||
switch (size) {
|
||||
case 0:
|
||||
@ -219,6 +218,8 @@ exports.readVarint = function readVarint(data, off) {
|
||||
size++;
|
||||
}
|
||||
|
||||
assert(utils.isSafeInteger(num), 'Number exceeds 2^53-1.');
|
||||
|
||||
return { size: size, value: num };
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user