From bb7f500bb117a33ebfd46d6d24ad1d84d9bb819e Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 14 May 2021 19:11:52 +0100 Subject: [PATCH] Add sanity check into SemanticTest for not allowing ABIEncoderV1Only and compileViaYul together --- test/libsolidity/SemanticTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/libsolidity/SemanticTest.cpp b/test/libsolidity/SemanticTest.cpp index b56e25703..147349619 100644 --- a/test/libsolidity/SemanticTest.cpp +++ b/test/libsolidity/SemanticTest.cpp @@ -99,6 +99,14 @@ SemanticTest::SemanticTest( if (m_runWithABIEncoderV1Only && !solidity::test::CommonOptions::get().useABIEncoderV1) 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")); soltestAssert(revertStrings, "Invalid revertStrings setting."); m_revertStrings = revertStrings.value();