Merge pull request #7042 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

View File

@ -85,6 +85,8 @@ public:
std::string render() const; std::string render() const;
private: private:
// Prevent implicit cast to bool
Whiskers& operator()(std::string _parameter, long long);
void checkParameterValid(std::string const& _parameter) const; void checkParameterValid(std::string const& _parameter) const;
void checkParameterUnknown(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> </byteArray>
})") })")
("functionName", functionName) ("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()) ("byteArray", _type.isByteArray())
("mul", overflowCheckedIntMulFunction(*TypeProvider::uint256())) ("mul", overflowCheckedIntMulFunction(*TypeProvider::uint256()))
.render(); .render();