From 3f34b2d5f4cc7ca337f95248c2d383b71a2b9f23 Mon Sep 17 00:00:00 2001 From: Soo Hwang Date: Sun, 17 Dec 2023 20:21:11 +0900 Subject: [PATCH] (#42) unit0 encoding failure fix --- protobuf-solidity/src/protoc/plugin/runtime/ProtoBufRuntime.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protobuf-solidity/src/protoc/plugin/runtime/ProtoBufRuntime.sol b/protobuf-solidity/src/protoc/plugin/runtime/ProtoBufRuntime.sol index b8e9e62..56e63be 100644 --- a/protobuf-solidity/src/protoc/plugin/runtime/ProtoBufRuntime.sol +++ b/protobuf-solidity/src/protoc/plugin/runtime/ProtoBufRuntime.sol @@ -2922,7 +2922,7 @@ library ProtoBufRuntime { uint256 base = 0xff; uint256 realSize = sz; while ( - x & (base << (realSize * BYTE_SIZE - BYTE_SIZE)) == 0 && realSize > 0 + realSize > 0 && x & (base << (realSize * BYTE_SIZE - BYTE_SIZE)) == 0 ) { realSize -= 1; }