Skip to content

Commit 3bb77a4

Browse files
committed
Change assertion type in GasMeter.
1 parent 87a9c42 commit 3bb77a4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

libevmasm/GasMeter.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ unsigned GasMeter::runGas(Instruction _instruction, langutil::EVMVersion _evmVer
298298

299299
if (auto gasCost = gasCostForTier(instructionInfo(_instruction, _evmVersion).gasPriceTier))
300300
return *gasCost;
301-
assertThrow(false, OptimizerException, "Invalid gas tier for instruction " + instructionInfo(_instruction, _evmVersion).name);
301+
solAssert(false, "Invalid gas tier for instruction " + instructionInfo(_instruction, _evmVersion).name);
302302
}
303303

304304
unsigned GasMeter::pushGas(u256 _value, langutil::EVMVersion _evmVersion)
@@ -314,7 +314,7 @@ unsigned GasMeter::swapGas(size_t _depth, langutil::EVMVersion _evmVersion)
314314
if (_depth <= 16)
315315
return runGas(evmasm::swapInstruction(static_cast<unsigned>(_depth)), _evmVersion);
316316
auto gasCost = gasCostForTier(instructionInfo(evmasm::Instruction::SWAPN, _evmVersion).gasPriceTier);
317-
assertThrow(gasCost.has_value(), OptimizerException, "Expected gas cost for SWAPN to be defined.");
317+
solAssert(gasCost.has_value(), "Expected gas cost for SWAPN to be defined.");
318318
return *gasCost;
319319
}
320320

@@ -323,7 +323,7 @@ unsigned GasMeter::dupGas(size_t _depth, langutil::EVMVersion _evmVersion)
323323
if (_depth <= 16)
324324
return runGas(evmasm::swapInstruction(static_cast<unsigned>(_depth)), _evmVersion);
325325
auto gasCost = gasCostForTier(instructionInfo(evmasm::Instruction::DUPN, _evmVersion).gasPriceTier);
326-
assertThrow(gasCost.has_value(), OptimizerException, "Expected gas cost for DUPN to be defined.");
326+
solAssert(gasCost.has_value(), "Expected gas cost for DUPN to be defined.");
327327
return *gasCost;
328328
}
329329

@@ -337,14 +337,14 @@ u256 GasMeter::dataGas(bytes const& _data, bool _inCreation, langutil::EVMVersio
337337
}
338338
else
339339
gas = bigint(GasCosts::createDataGas) * _data.size();
340-
assertThrow(gas < bigint(u256(-1)), OptimizerException, "Gas cost exceeds 256 bits.");
340+
solAssert(gas < bigint(u256(-1)), "Gas cost exceeds 256 bits.");
341341
return u256(gas);
342342
}
343343

344344

345345
u256 GasMeter::dataGas(uint64_t _length, bool _inCreation, langutil::EVMVersion _evmVersion)
346346
{
347347
bigint gas = bigint(_length) * (_inCreation ? GasCosts::txDataNonZeroGas(_evmVersion) : GasCosts::createDataGas);
348-
assertThrow(gas < bigint(u256(-1)), OptimizerException, "Gas cost exceeds 256 bits.");
348+
solAssert(gas < bigint(u256(-1)), "Gas cost exceeds 256 bits.");
349349
return u256(gas);
350350
}

0 commit comments

Comments
 (0)