mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fixing additional signedness errors after adding -Wsign-conversion flag
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
This commit is contained in:
co-authored by
Kamil Śliwak
parent
3c57e04751
commit
547590b972
@@ -184,13 +184,13 @@ void ProtoConverter::visit(VarRef const& _x)
|
||||
{
|
||||
// Ensure that there is at least one variable declaration to reference in function scope.
|
||||
yulAssert(m_currentFuncVars.size() > 0, "Proto fuzzer: No variables to reference.");
|
||||
m_output << *m_currentFuncVars[_x.varnum() % m_currentFuncVars.size()];
|
||||
m_output << *m_currentFuncVars[static_cast<size_t>(_x.varnum()) % m_currentFuncVars.size()];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Ensure that there is at least one variable declaration to reference in nested scopes.
|
||||
yulAssert(m_currentGlobalVars.size() > 0, "Proto fuzzer: No global variables to reference.");
|
||||
m_output << *m_currentGlobalVars[_x.varnum() % m_currentGlobalVars.size()];
|
||||
m_output << *m_currentGlobalVars[static_cast<size_t>(_x.varnum()) % m_currentGlobalVars.size()];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ DEFINE_PROTO_FUZZER(Program const& _input)
|
||||
// With libFuzzer binary run this to generate a YUL source file x.yul:
|
||||
// PROTO_FUZZER_DUMP_PATH=x.yul ./a.out proto-input
|
||||
ofstream of(dump_path);
|
||||
of.write(sol_source.data(), sol_source.size());
|
||||
of.write(sol_source.data(), static_cast<streamsize>(sol_source.size()));
|
||||
}
|
||||
|
||||
if (char const* dump_path = getenv("SOL_DEBUG_FILE"))
|
||||
|
||||
@@ -43,7 +43,7 @@ DEFINE_PROTO_FUZZER(Program const& _input)
|
||||
// With libFuzzer binary run this to generate a YUL source file x.yul:
|
||||
// PROTO_FUZZER_DUMP_PATH=x.yul ./a.out proto-input
|
||||
ofstream of(dump_path);
|
||||
of.write(yul_source.data(), yul_source.size());
|
||||
of.write(yul_source.data(), static_cast<streamsize>(yul_source.size()));
|
||||
}
|
||||
|
||||
if (yul_source.size() > 1200)
|
||||
|
||||
@@ -64,7 +64,7 @@ DEFINE_PROTO_FUZZER(Program const& _input)
|
||||
// With libFuzzer binary run this to generate a YUL source file x.yul:
|
||||
// PROTO_FUZZER_DUMP_PATH=x.yul ./a.out proto-input
|
||||
ofstream of(dump_path);
|
||||
of.write(yul_source.data(), yul_source.size());
|
||||
of.write(yul_source.data(), static_cast<streamsize>(yul_source.size()));
|
||||
}
|
||||
|
||||
YulStringRepository::reset();
|
||||
|
||||
Reference in New Issue
Block a user