mirror of https://github.com/status-im/evmc.git
test: Rewrite an unit test to avoid UBSan warning
Previously in the last iteration of the for loop the value EVMC_MAX_REVISION + 1 is assigned to rev of type evmc_revision what triggers an UBSan warning.
This commit is contained in:
parent
e2a162d28c
commit
a31c82373f
|
@ -113,9 +113,9 @@ TEST(instructions, constantinople_hard_fork)
|
|||
|
||||
TEST(instructions, name_gas_cost_equivalence)
|
||||
{
|
||||
for (auto rev = EVMC_FRONTIER; rev <= EVMC_MAX_REVISION;
|
||||
rev = static_cast<evmc_revision>(rev + 1))
|
||||
for (auto r = int{EVMC_FRONTIER}; r <= EVMC_MAX_REVISION; ++r)
|
||||
{
|
||||
const auto rev = static_cast<evmc_revision>(r);
|
||||
const auto names = evmc_get_instruction_names_table(rev);
|
||||
const auto metrics = evmc_get_instruction_metrics_table(rev);
|
||||
|
||||
|
|
Loading…
Reference in New Issue