From 140dbfdbd8f4319d1d02339feea0a8636a3738e5 Mon Sep 17 00:00:00 2001 From: Cryptomental Date: Tue, 10 Jul 2018 09:18:59 +0200 Subject: Code, Changelog, ReleaseChecklist: Fix typos. Refs: #4442 --- libevmasm/LinkerObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libevmasm/LinkerObject.cpp') diff --git a/libevmasm/LinkerObject.cpp b/libevmasm/LinkerObject.cpp index 8b7d9e06..1d5efecb 100644 --- a/libevmasm/LinkerObject.cpp +++ b/libevmasm/LinkerObject.cpp @@ -68,7 +68,7 @@ LinkerObject::matchLibrary( if (it != _libraryAddresses.end()) return &it->second; // If the user did not supply a fully qualified library name, - // try to match only the simple libary name + // try to match only the simple library name size_t colon = _linkRefName.find(':'); if (colon == string::npos) return nullptr; -- cgit v1.2.3 From 6daeb39ecc7ffd0e834e63f6495442c4211c5c1c Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 4 Oct 2018 14:55:02 +0200 Subject: Use hash for library placeholders. --- libevmasm/LinkerObject.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libevmasm/LinkerObject.cpp') diff --git a/libevmasm/LinkerObject.cpp b/libevmasm/LinkerObject.cpp index 1d5efecb..0ac69966 100644 --- a/libevmasm/LinkerObject.cpp +++ b/libevmasm/LinkerObject.cpp @@ -21,6 +21,7 @@ #include #include +#include using namespace dev; using namespace dev::eth; @@ -50,14 +51,19 @@ string LinkerObject::toHex() const for (auto const& ref: linkReferences) { size_t pos = ref.first * 2; - string const& name = ref.second; + string hash = libraryPlaceholder(ref.second); hex[pos] = hex[pos + 1] = hex[pos + 38] = hex[pos + 39] = '_'; for (size_t i = 0; i < 36; ++i) - hex[pos + 2 + i] = i < name.size() ? name[i] : '_'; + hex[pos + 2 + i] = hash.at(i); } return hex; } +string LinkerObject::libraryPlaceholder(string const& _libraryName) +{ + return keccak256(_libraryName).hex().substr(0, 36); +} + h160 const* LinkerObject::matchLibrary( string const& _linkRefName, -- cgit v1.2.3 From 4d6d224cf83195db8dcea1f5015a68d1ce2dca0f Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 8 Oct 2018 14:59:40 +0200 Subject: Prefix "0x" to library placeholder. --- libevmasm/LinkerObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libevmasm/LinkerObject.cpp') diff --git a/libevmasm/LinkerObject.cpp b/libevmasm/LinkerObject.cpp index 0ac69966..e9c73908 100644 --- a/libevmasm/LinkerObject.cpp +++ b/libevmasm/LinkerObject.cpp @@ -61,7 +61,7 @@ string LinkerObject::toHex() const string LinkerObject::libraryPlaceholder(string const& _libraryName) { - return keccak256(_libraryName).hex().substr(0, 36); + return "0x" + keccak256(_libraryName).hex().substr(0, 34); } h160 const* -- cgit v1.2.3 From 26c693aa920ec1ea41ef7994a3dc8bb45b78f866 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 8 Oct 2018 15:08:12 +0200 Subject: Change library placeholder to `__$$__`. --- libevmasm/LinkerObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libevmasm/LinkerObject.cpp') diff --git a/libevmasm/LinkerObject.cpp b/libevmasm/LinkerObject.cpp index e9c73908..a11f2378 100644 --- a/libevmasm/LinkerObject.cpp +++ b/libevmasm/LinkerObject.cpp @@ -61,7 +61,7 @@ string LinkerObject::toHex() const string LinkerObject::libraryPlaceholder(string const& _libraryName) { - return "0x" + keccak256(_libraryName).hex().substr(0, 34); + return "$" + keccak256(_libraryName).hex().substr(0, 34) + "$"; } h160 const* -- cgit v1.2.3 From e78b95d9d4ecb6d8d56ca0f04a6f9b4f7d974fbb Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 18 Oct 2018 13:35:20 +0200 Subject: Renamed SHA3.{h,cpp} files. --- libevmasm/LinkerObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libevmasm/LinkerObject.cpp') diff --git a/libevmasm/LinkerObject.cpp b/libevmasm/LinkerObject.cpp index a11f2378..6eec54ea 100644 --- a/libevmasm/LinkerObject.cpp +++ b/libevmasm/LinkerObject.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include using namespace dev; using namespace dev::eth; -- cgit v1.2.3