Fix: Segfaults connected to paramater types.

parameterTypes does not return by const reference anymore.
This commit is contained in:
chriseth
2015-12-09 17:57:34 +01:00
parent 15a1468c3f
commit 39f57a9c71
4 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -278,9 +278,9 @@ void CommandLineInterface::handleGasEstimation(string const& _contract)
gas = GasEstimator::functionalEstimation(*items, entry, *it);
FunctionType type(*it);
cout << " " << it->name() << "(";
auto end = type.parameterTypes().end();
for (auto it = type.parameterTypes().begin(); it != end; ++it)
cout << (*it)->toString() << (it + 1 == end ? "" : ",");
auto paramTypes = type.parameterTypes();
for (auto it = paramTypes.begin(); it != paramTypes.end(); ++it)
cout << (*it)->toString() << (it + 1 == paramTypes.end() ? "" : ",");
cout << "):\t" << gas << endl;
}
}
+3 -3
View File
@@ -103,9 +103,9 @@ Json::Value estimateGas(CompilerStack const& _compiler, string const& _contract)
gas = GasEstimator::functionalEstimation(*items, entry, *it);
FunctionType type(*it);
string sig = it->name() + "(";
auto end = type.parameterTypes().end();
for (auto it = type.parameterTypes().begin(); it != end; ++it)
sig += (*it)->toString() + (it + 1 == end ? "" : ",");
auto paramTypes = type.parameterTypes();
for (auto it = paramTypes.begin(); it != paramTypes.end(); ++it)
sig += (*it)->toString() + (it + 1 == paramTypes.end() ? "" : ",");
sig += ")";
internalFunctions[sig] = gasToJson(gas);
}