From 3e51d14c6dc1d00eece127416c77071d422d62b9 Mon Sep 17 00:00:00 2001 From: Mathias Baumann Date: Thu, 4 Jul 2019 09:30:58 +0200 Subject: [PATCH 1/2] Fix missing int -> string conversion --- libsolidity/codegen/YulUtilFunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsolidity/codegen/YulUtilFunctions.cpp b/libsolidity/codegen/YulUtilFunctions.cpp index 13e410a74..c8b2e2d03 100644 --- a/libsolidity/codegen/YulUtilFunctions.cpp +++ b/libsolidity/codegen/YulUtilFunctions.cpp @@ -655,7 +655,7 @@ string YulUtilFunctions::arrayConvertLengthToSize(ArrayType const& _type) })") ("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(); From 08b9da0df5d1e36c47b556b24085cdadf0357480 Mon Sep 17 00:00:00 2001 From: Mathias Baumann Date: Wed, 3 Jul 2019 16:48:07 +0200 Subject: [PATCH 2/2] Make Whiskers fail early when called with int --- libdevcore/Whiskers.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libdevcore/Whiskers.h b/libdevcore/Whiskers.h index ebe17b51c..5d326bf02 100644 --- a/libdevcore/Whiskers.h +++ b/libdevcore/Whiskers.h @@ -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;