Merge pull request from ethereum/make-whiskers-fail-early

Make Whiskers fail early when called with int
This commit is contained in:
chriseth 2019-07-04 12:19:54 +02:00 committed by GitHub
commit 2e01816c6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions
libdevcore
libsolidity/codegen

View File

@ -85,6 +85,8 @@ public:
std::string render() const;
private:
// Prevent implicit cast to bool
Whiskers& operator()(std::string _parameter, long long);
void checkParameterValid(std::string const& _parameter) const;
void checkParameterUnknown(std::string const& _parameter) const;

View File

@ -655,7 +655,7 @@ string YulUtilFunctions::arrayConvertLengthToSize(ArrayType const& _type)
</byteArray>
})")
("functionName", functionName)
("elementSize", _type.location() == DataLocation::Memory ? baseType.memoryHeadSize() : baseType.calldataEncodedSize())
("elementSize", to_string(_type.location() == DataLocation::Memory ? baseType.memoryHeadSize() : baseType.calldataEncodedSize()))
("byteArray", _type.isByteArray())
("mul", overflowCheckedIntMulFunction(*TypeProvider::uint256()))
.render();