@@ -76,6 +76,7 @@ unsigned Assembly::codeSize(unsigned subTagSize) const
76
76
77
77
void Assembly::addAssemblyItemsFromJSON (Json::Value const & _code)
78
78
{
79
+ solAssert (m_items.empty (), " " );
79
80
solAssert (_code.isArray (), " " );
80
81
for (auto const & jsonItem: _code)
81
82
m_items.emplace_back (loadItemFromJSON (jsonItem));
@@ -106,28 +107,27 @@ AssemblyItem Assembly::loadItemFromJSON(Json::Value const& _json)
106
107
std::string jumpType = _json[" jumpType" ].isString () ? _json[" jumpType" ].asString () : " " ;
107
108
solAssert (!name.empty (), " " );
108
109
110
+ SourceLocation location;
111
+ location.start = begin;
112
+ location.end = end;
113
+
109
114
auto updateUsedTags = [&](u256 const & data) {
110
- auto tag = static_cast <unsigned >(data);
111
- if (m_usedTags <= tag)
112
- m_usedTags = tag + 1 ;
115
+ m_usedTags = max (m_usedTags, static_cast <unsigned >(data) + 1 );
113
116
return data;
114
117
};
115
118
116
119
auto immutableHash = [&](string const & _immutableName) -> h256 {
117
- h256 hash (util::keccak256 (value ));
120
+ h256 hash (util::keccak256 (_immutableName ));
118
121
m_immutables[hash] = _immutableName;
119
122
return hash;
120
123
};
121
124
122
125
auto libraryHash = [&](string const & _libraryName) -> h256 {
123
- h256 hash (util::keccak256 (value ));
126
+ h256 hash (util::keccak256 (_libraryName ));
124
127
m_libraries[hash] = _libraryName;
125
128
return hash;
126
129
};
127
130
128
- SourceLocation location;
129
- location.start = begin;
130
- location.end = end;
131
131
if (srcIndex > -1 && srcIndex < static_cast <int >(sources ().size ()))
132
132
location.sourceName = sources ()[static_cast <size_t >(srcIndex)];
133
133
0 commit comments