mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Hash number literals according to their value instead of their string representation.
This commit is contained in:
@@ -54,7 +54,10 @@ std::map<Block const*, uint64_t> BlockHasher::run(Block const& _block)
|
||||
void BlockHasher::operator()(Literal const& _literal)
|
||||
{
|
||||
hash64(compileTimeLiteralHash("Literal"));
|
||||
hash64(_literal.value.hash());
|
||||
if (_literal.kind == LiteralKind::Number)
|
||||
hash64(std::hash<u256>{}(valueOfNumberLiteral(_literal)));
|
||||
else
|
||||
hash64(_literal.value.hash());
|
||||
hash64(_literal.type.hash());
|
||||
hash8(static_cast<uint8_t>(_literal.kind));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user