mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Omit require revert strings in IR code generator.
This commit is contained in:
parent
87a68feea1
commit
a3ee334b42
@ -1057,7 +1057,10 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall)
|
|||||||
solAssert(arguments.size() > 0, "Expected at least one parameter for require/assert");
|
solAssert(arguments.size() > 0, "Expected at least one parameter for require/assert");
|
||||||
solAssert(arguments.size() <= 2, "Expected no more than two parameters for require/assert");
|
solAssert(arguments.size() <= 2, "Expected no more than two parameters for require/assert");
|
||||||
|
|
||||||
Type const* messageArgumentType = arguments.size() > 1 ? arguments[1]->annotation().type : nullptr;
|
Type const* messageArgumentType =
|
||||||
|
arguments.size() > 1 && m_context.revertStrings() != RevertStrings::Strip ?
|
||||||
|
arguments[1]->annotation().type :
|
||||||
|
nullptr;
|
||||||
string requireOrAssertFunction = m_utils.requireOrAssertFunction(
|
string requireOrAssertFunction = m_utils.requireOrAssertFunction(
|
||||||
functionType->kind() == FunctionType::Kind::Assert,
|
functionType->kind() == FunctionType::Kind::Assert,
|
||||||
messageArgumentType
|
messageArgumentType
|
||||||
|
@ -5696,6 +5696,8 @@ BOOST_AUTO_TEST_CASE(strip_reason_strings)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
|
ALSO_VIA_YUL(
|
||||||
|
DISABLE_EWASM_TESTRUN()
|
||||||
m_revertStrings = RevertStrings::Default;
|
m_revertStrings = RevertStrings::Default;
|
||||||
compileAndRun(sourceCode, 0, "C");
|
compileAndRun(sourceCode, 0, "C");
|
||||||
|
|
||||||
@ -5719,6 +5721,7 @@ BOOST_AUTO_TEST_CASE(strip_reason_strings)
|
|||||||
ABI_CHECK(callContractFunction("f1(bool)", false), encodeArgs());
|
ABI_CHECK(callContractFunction("f1(bool)", false), encodeArgs());
|
||||||
ABI_CHECK(callContractFunction("g1(bool)", true), encodeArgs(10));
|
ABI_CHECK(callContractFunction("g1(bool)", true), encodeArgs(10));
|
||||||
ABI_CHECK(callContractFunction("g1(bool)", false), encodeArgs());
|
ABI_CHECK(callContractFunction("g1(bool)", false), encodeArgs());
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
Loading…
Reference in New Issue
Block a user