mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge remote-tracking branch 'origin/develop' into breaking
This commit is contained in:
@@ -418,7 +418,7 @@ string ProtoConverter::visit(TestFunction const& _x, string const& _storageVarDe
|
||||
("functionDeclReturndata", functionDeclReturndata)
|
||||
("storageVarDefs", _storageVarDefs)
|
||||
("localVarDefs", localVarDefs)
|
||||
("calldataTestCode", testCallDataFunction(_x.invalid_encoding_length()))
|
||||
("calldataTestCode", testCallDataFunction(static_cast<unsigned>(_x.invalid_encoding_length())))
|
||||
("returndataTestCode", testReturnDataFunction())
|
||||
("return_types", m_types.str())
|
||||
("return_values", m_argsCoder.str())
|
||||
|
||||
@@ -37,7 +37,7 @@ struct SolRandomNumGenerator
|
||||
/// @returns a pseudo random unsigned integer
|
||||
unsigned operator()()
|
||||
{
|
||||
return m_random();
|
||||
return static_cast<unsigned>(m_random());
|
||||
}
|
||||
|
||||
RandomEngine m_random;
|
||||
|
||||
@@ -182,9 +182,9 @@ bool ProtoConverter::functionCallNotPossible(FunctionCall_Returns _type)
|
||||
unsigned ProtoConverter::numVarsInScope()
|
||||
{
|
||||
if (m_inFunctionDef)
|
||||
return m_currentFuncVars.size();
|
||||
return static_cast<unsigned>(m_currentFuncVars.size());
|
||||
else
|
||||
return m_currentGlobalVars.size();
|
||||
return static_cast<unsigned>(m_currentGlobalVars.size());
|
||||
}
|
||||
|
||||
void ProtoConverter::visit(VarRef const& _x)
|
||||
@@ -1344,12 +1344,12 @@ void ProtoConverter::visit(UnaryOpData const& _x)
|
||||
{
|
||||
case UnaryOpData::SIZE:
|
||||
m_output << Whiskers(R"(datasize("<id>"))")
|
||||
("id", getObjectIdentifier(_x.identifier()))
|
||||
("id", getObjectIdentifier(static_cast<unsigned>(_x.identifier())))
|
||||
.render();
|
||||
break;
|
||||
case UnaryOpData::OFFSET:
|
||||
m_output << Whiskers(R"(dataoffset("<id>"))")
|
||||
("id", getObjectIdentifier(_x.identifier()))
|
||||
("id", getObjectIdentifier(static_cast<unsigned>(_x.identifier())))
|
||||
.render();
|
||||
break;
|
||||
}
|
||||
@@ -1473,7 +1473,7 @@ void ProtoConverter::openFunctionScope(vector<string> const& _funcParams)
|
||||
|
||||
void ProtoConverter::updateFunctionMaps(string const& _var)
|
||||
{
|
||||
unsigned erased = m_functionSigMap.erase(_var);
|
||||
size_t erased = m_functionSigMap.erase(_var);
|
||||
|
||||
for (auto const& i: m_functionDefMap)
|
||||
if (i.second == _var)
|
||||
@@ -1491,7 +1491,7 @@ void ProtoConverter::closeBlockScope()
|
||||
// out of scope from the global function map.
|
||||
for (auto const& f: m_scopeFuncs.back())
|
||||
{
|
||||
unsigned numFuncsRemoved = m_functions.size();
|
||||
size_t numFuncsRemoved = m_functions.size();
|
||||
m_functions.erase(remove(m_functions.begin(), m_functions.end(), f), m_functions.end());
|
||||
numFuncsRemoved -= m_functions.size();
|
||||
yulAssert(
|
||||
@@ -1908,7 +1908,7 @@ void ProtoConverter::buildObjectScopeTree(Object const& _x)
|
||||
void ProtoConverter::visit(Program const& _x)
|
||||
{
|
||||
// Initialize input size
|
||||
m_inputSize = _x.ByteSizeLong();
|
||||
m_inputSize = static_cast<unsigned>(_x.ByteSizeLong());
|
||||
|
||||
// Record EVM Version
|
||||
m_evmVersion = evmVersionMapping(_x.ver());
|
||||
|
||||
@@ -38,7 +38,7 @@ struct YulRandomNumGenerator
|
||||
|
||||
unsigned operator()()
|
||||
{
|
||||
return m_random();
|
||||
return static_cast<unsigned>(m_random());
|
||||
}
|
||||
|
||||
RandomEngine m_random;
|
||||
|
||||
@@ -40,7 +40,7 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* _data, size_t _size)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
FuzzerUtil::testCompiler(sourceCode, /*optimize=*/false, /*_rand=*/_size);
|
||||
FuzzerUtil::testCompiler(sourceCode, /*optimize=*/false, /*_rand=*/static_cast<unsigned>(_size));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* _data, size_t _size)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
FuzzerUtil::testCompiler(sourceCode, /*optimize=*/true, /*rand=*/_size);
|
||||
FuzzerUtil::testCompiler(sourceCode, /*optimize=*/true, /*rand=*/static_cast<unsigned>(_size));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -451,7 +451,8 @@ u256 EVMInstructionInterpreter::evalBuiltin(
|
||||
else
|
||||
{
|
||||
// Force different value than for datasize
|
||||
arg[31] += 2;
|
||||
arg[31]++;
|
||||
arg[31]++;
|
||||
return u256(keccak256(arg)) & 0xfff;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,9 @@ u256 EwasmBuiltinInterpreter::evalBuiltin(
|
||||
return u256(util::keccak256(arg)) & 0xfff;
|
||||
else if (fun == "dataoffset")
|
||||
{
|
||||
arg[31] += 2;
|
||||
// Force different value than for datasize
|
||||
arg[31]++;
|
||||
arg[31]++;
|
||||
return u256(util::keccak256(arg)) & 0xfff;
|
||||
}
|
||||
}
|
||||
@@ -198,7 +200,7 @@ u256 EwasmBuiltinInterpreter::evalBuiltin(
|
||||
else if (fun == "i32.store")
|
||||
{
|
||||
accessMemory(arg[0], 4);
|
||||
writeMemoryHalfWord(arg[0], arg[1]);
|
||||
writeMemoryHalfWord(arg[0], static_cast<uint32_t>(arg[1]));
|
||||
return 0;
|
||||
}
|
||||
else if (fun == "i32.load")
|
||||
@@ -453,7 +455,7 @@ u256 EwasmBuiltinInterpreter::evalEthBuiltin(string const& _fun, vector<uint64_t
|
||||
readBytes32(arg[5]);
|
||||
if (numberOfTopics > 3)
|
||||
readBytes32(arg[6]);
|
||||
logTrace(evmasm::logInstruction(numberOfTopics), {});
|
||||
logTrace(evmasm::logInstruction(static_cast<unsigned>(numberOfTopics)), {});
|
||||
return 0;
|
||||
}
|
||||
else if (_fun == "getBlockNumber")
|
||||
@@ -538,7 +540,7 @@ uint32_t EwasmBuiltinInterpreter::readMemoryHalfWord(uint64_t _offset)
|
||||
{
|
||||
uint32_t r = 0;
|
||||
for (size_t i = 0; i < 4; i++)
|
||||
r |= uint64_t(m_state.memory[_offset + i]) << (i * 8);
|
||||
r |= uint32_t(m_state.memory[_offset + i]) << (i * 8);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
auto printPair = [&](auto const& optionAndDescription)
|
||||
{
|
||||
cout << optionAndDescription.first << ": ";
|
||||
cout << setw(longestDescriptionLength) << setiosflags(ios::left);
|
||||
cout << setw(static_cast<int>(longestDescriptionLength)) << setiosflags(ios::left);
|
||||
cout << optionAndDescription.second << " ";
|
||||
|
||||
++index;
|
||||
@@ -165,8 +165,9 @@ public:
|
||||
printUsageBanner(abbreviationMap, extraOptions, 4);
|
||||
cout << "? ";
|
||||
cout.flush();
|
||||
int option = readStandardInputChar();
|
||||
cout << ' ' << char(option) << endl;
|
||||
// TODO: handle EOF properly.
|
||||
char option = static_cast<char>(readStandardInputChar());
|
||||
cout << ' ' << option << endl;
|
||||
|
||||
OptimiserStepContext context{m_dialect, *m_nameDispenser, reservedIdentifiers};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user