Add sanity check into SemanticTest for not allowing ABIEncoderV1Only and compileViaYul together

This commit is contained in:
Alex Beregszaszi 2021-05-14 19:11:52 +01:00
parent 324caef53c
commit bb7f500bb1

View File

@ -99,6 +99,14 @@ SemanticTest::SemanticTest(
if (m_runWithABIEncoderV1Only && !solidity::test::CommonOptions::get().useABIEncoderV1) if (m_runWithABIEncoderV1Only && !solidity::test::CommonOptions::get().useABIEncoderV1)
m_shouldRun = false; m_shouldRun = false;
// Sanity check
if (m_runWithABIEncoderV1Only && (compileViaYul == "true" || compileViaYul == "also"))
BOOST_THROW_EXCEPTION(runtime_error(
"ABIEncoderV1Only can not be used with compileViaYul=" + compileViaYul +
", set it to false or omit the flag. The compileViaYul setting ignores the abicoder pragma"
" and runs everything with ABICoder V2."
));
auto revertStrings = revertStringsFromString(m_reader.stringSetting("revertStrings", "default")); auto revertStrings = revertStringsFromString(m_reader.stringSetting("revertStrings", "default"));
soltestAssert(revertStrings, "Invalid revertStrings setting."); soltestAssert(revertStrings, "Invalid revertStrings setting.");
m_revertStrings = revertStrings.value(); m_revertStrings = revertStrings.value();