diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-08-06 20:59:37 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-08-13 20:27:01 +0800 |
commit | 7d7abeb1496dddfab7eb8705dbfc3d06284cf25d (patch) | |
tree | 2909fe73439256e0f77231ec219b1b9af6fefd5a /test/compilationTests | |
parent | 43db88b8363d73ee2f5ffa094ff506414261bd11 (diff) | |
download | dexon-solidity-7d7abeb1496dddfab7eb8705dbfc3d06284cf25d.tar.gz dexon-solidity-7d7abeb1496dddfab7eb8705dbfc3d06284cf25d.tar.zst dexon-solidity-7d7abeb1496dddfab7eb8705dbfc3d06284cf25d.zip |
Disallow ambiguous conversions between number literals and bytesXX types.
Diffstat (limited to 'test/compilationTests')
-rw-r--r-- | test/compilationTests/stringutils/strings.sol | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/compilationTests/stringutils/strings.sol b/test/compilationTests/stringutils/strings.sol index 6865664b..f89a2527 100644 --- a/test/compilationTests/stringutils/strings.sol +++ b/test/compilationTests/stringutils/strings.sol @@ -83,23 +83,23 @@ library strings { uint ret; if (self == 0) return 0; - if (self & 0xffffffffffffffffffffffffffffffff == 0) { + if (uint256(self) & 0xffffffffffffffffffffffffffffffff == 0) { ret += 16; self = bytes32(uint(self) / 0x100000000000000000000000000000000); } - if (self & 0xffffffffffffffff == 0) { + if (uint256(self) & 0xffffffffffffffff == 0) { ret += 8; self = bytes32(uint(self) / 0x10000000000000000); } - if (self & 0xffffffff == 0) { + if (uint256(self) & 0xffffffff == 0) { ret += 4; self = bytes32(uint(self) / 0x100000000); } - if (self & 0xffff == 0) { + if (uint256(self) & 0xffff == 0) { ret += 2; self = bytes32(uint(self) / 0x10000); } - if (self & 0xff == 0) { + if (uint256(self) & 0xff == 0) { ret += 1; } return 32 - ret; |