Merge remote-tracking branch 'origin/develop' into breaking

This commit is contained in:
chriseth
2021-10-06 12:00:17 +02:00
733 changed files with 18775 additions and 5313 deletions
+3
View File
@@ -143,6 +143,8 @@ set(libyul_sources
libyul/ObjectCompilerTest.h
libyul/ObjectParser.cpp
libyul/Parser.cpp
libyul/StackLayoutGeneratorTest.cpp
libyul/StackLayoutGeneratorTest.h
libyul/SyntaxTest.h
libyul/SyntaxTest.cpp
libyul/YulInterpreterTest.cpp
@@ -158,6 +160,7 @@ set(solcli_sources
solc/Common.cpp
solc/Common.h
solc/CommandLineInterface.cpp
solc/CommandLineInterfaceAllowPaths.cpp
solc/CommandLineParser.cpp
)
detect_stray_source_files("${solcli_sources}" "solc/")
+17 -11
View File
@@ -91,22 +91,27 @@ CommonOptions::CommonOptions(std::string _caption):
po::options_description::m_default_line_length,
po::options_description::m_default_line_length - 23
)
{
}
void CommonOptions::addOptions()
{
options.add_options()
("evm-version", po::value(&evmVersionString), "which evm version to use")
("testpath", po::value<fs::path>(&this->testPath)->default_value(solidity::test::testPath()), "path to test files")
("vm", po::value<std::vector<fs::path>>(&vmPaths), "path to evmc library, can be supplied multiple times.")
("ewasm", po::bool_switch(&ewasm), "tries to automatically find an ewasm vm and enable ewasm test-execution.")
("no-semantic-tests", po::bool_switch(&disableSemanticTests), "disable semantic tests")
("no-smt", po::bool_switch(&disableSMT), "disable SMT checker")
("optimize", po::bool_switch(&optimize), "enables optimization")
("enforce-via-yul", po::bool_switch(&enforceViaYul), "Enforce compiling all tests via yul to see if additional tests can be activated.")
("enforce-compile-to-ewasm", po::bool_switch(&enforceCompileToEwasm), "Enforce compiling all tests to Ewasm to see if additional tests can be activated.")
("enforce-gas-cost", po::bool_switch(&enforceGasTest), "Enforce checking gas cost in semantic tests.")
("enforce-gas-cost-min-value", po::value(&enforceGasTestMinValue), "Threshold value to enforce adding gas checks to a test.")
("abiencoderv1", po::bool_switch(&useABIEncoderV1), "enables abi encoder v1")
("show-messages", po::bool_switch(&showMessages), "enables message output")
("show-metadata", po::bool_switch(&showMetadata), "enables metadata output");
("ewasm", po::bool_switch(&ewasm)->default_value(ewasm), "tries to automatically find an ewasm vm and enable ewasm test-execution.")
("no-semantic-tests", po::bool_switch(&disableSemanticTests)->default_value(disableSemanticTests), "disable semantic tests")
("no-smt", po::bool_switch(&disableSMT)->default_value(disableSMT), "disable SMT checker")
("optimize", po::bool_switch(&optimize)->default_value(optimize), "enables optimization")
("enforce-via-yul", po::value<bool>(&enforceViaYul)->default_value(enforceViaYul)->implicit_value(true), "Enforce compiling all tests via yul to see if additional tests can be activated.")
("enforce-compile-to-ewasm", po::bool_switch(&enforceCompileToEwasm)->default_value(enforceCompileToEwasm), "Enforce compiling all tests to Ewasm to see if additional tests can be activated.")
("enforce-gas-cost", po::value<bool>(&enforceGasTest)->default_value(enforceGasTest)->implicit_value(true), "Enforce checking gas cost in semantic tests.")
("enforce-gas-cost-min-value", po::value(&enforceGasTestMinValue)->default_value(enforceGasTestMinValue), "Threshold value to enforce adding gas checks to a test.")
("abiencoderv1", po::bool_switch(&useABIEncoderV1)->default_value(useABIEncoderV1), "enables abi encoder v1")
("show-messages", po::bool_switch(&showMessages)->default_value(showMessages), "enables message output")
("show-metadata", po::bool_switch(&showMetadata)->default_value(showMetadata), "enables metadata output");
}
void CommonOptions::validate() const
@@ -139,6 +144,7 @@ void CommonOptions::validate() const
bool CommonOptions::parse(int argc, char const* const* argv)
{
po::variables_map arguments;
addOptions();
po::command_line_parser cmdLineParser(argc, argv);
cmdLineParser.options(options);
+1
View File
@@ -70,6 +70,7 @@ struct CommonOptions
langutil::EVMVersion evmVersion() const;
virtual void addOptions();
virtual bool parse(int argc, char const* const* argv);
// Throws a ConfigException on error
virtual void validate() const;
+1 -1
View File
@@ -856,7 +856,7 @@ void EVMHostPrinter::selfdestructRecords()
void EVMHostPrinter::callRecords()
{
static const auto callKind = [](evmc_call_kind _kind) -> string
static auto constexpr callKind = [](evmc_call_kind _kind) -> string
{
switch (_kind)
{
+5 -4
View File
@@ -40,6 +40,7 @@
#include <range/v3/view/transform.hpp>
#include <cstdlib>
#include <limits>
using namespace std;
using namespace solidity;
@@ -102,8 +103,8 @@ std::pair<bool, string> ExecutionFramework::compareAndCreateMessage(
std::string message =
"Invalid encoded data\n"
" Result Expectation\n";
auto resultHex = boost::replace_all_copy(toHex(_result), "0", ".");
auto expectedHex = boost::replace_all_copy(toHex(_expectation), "0", ".");
auto resultHex = boost::replace_all_copy(util::toHex(_result), "0", ".");
auto expectedHex = boost::replace_all_copy(util::toHex(_expectation), "0", ".");
for (size_t i = 0; i < std::max(resultHex.size(), expectedHex.size()); i += 0x40)
{
std::string result{i >= resultHex.size() ? string{} : resultHex.substr(i, 0x40)};
@@ -163,7 +164,7 @@ void ExecutionFramework::sendMessage(bytes const& _data, bool _isCreation, u256
cout << "CALL " << m_sender.hex() << " -> " << m_contractAddress.hex() << ":" << endl;
if (_value > 0)
cout << " value: " << _value << endl;
cout << " in: " << toHex(_data) << endl;
cout << " in: " << util::toHex(_data) << endl;
}
evmc_message message = {};
message.input_data = _data.data();
@@ -194,7 +195,7 @@ void ExecutionFramework::sendMessage(bytes const& _data, bool _isCreation, u256
if (m_showMessages)
{
cout << " out: " << toHex(m_output) << endl;
cout << " out: " << util::toHex(m_output) << endl;
cout << " result: " << static_cast<size_t>(result.status_code) << endl;
cout << " gas used: " << m_gasUsed.str() << endl;
}
+3 -4
View File
@@ -49,9 +49,8 @@ namespace solidity::test
using rational = boost::rational<bigint>;
// The ether and gwei denominations; here for ease of use where needed within code.
static const u256 gwei = u256(1) << 9;
static const u256 ether = u256(1) << 18;
static u256 const gwei = u256(1) << 9;
static u256 const ether = u256(1) << 18;
class ExecutionFramework
{
@@ -170,7 +169,7 @@ public:
static bytes encode(size_t _value) { return encode(u256(_value)); }
static bytes encode(char const* _value) { return encode(std::string(_value)); }
static bytes encode(uint8_t _value) { return bytes(31, 0) + bytes{_value}; }
static bytes encode(u256 const& _value) { return util::toBigEndian(_value); }
static bytes encode(u256 const& _value) { return toBigEndian(_value); }
/// @returns the fixed-point encoding of a rational number with a given
/// number of fractional bits.
static bytes encode(std::pair<rational, int> const& _valueAndPrecision)
+7 -2
View File
@@ -31,7 +31,8 @@ void solidity::test::createFilesWithParentDirs(set<boost::filesystem::path> cons
if (!path.parent_path().empty())
boost::filesystem::create_directories(path.parent_path());
ofstream newFile(path.string());
// Use binary mode to avoid line ending conversion on Windows.
ofstream newFile(path.string(), std::ofstream::binary);
newFile << _content;
if (newFile.fail() || !boost::filesystem::exists(path))
@@ -53,13 +54,17 @@ void solidity::test::createFileWithContent(boost::filesystem::path const& _path,
}
bool solidity::test::createSymlinkIfSupportedByFilesystem(
boost::filesystem::path const& _targetPath,
boost::filesystem::path _targetPath,
boost::filesystem::path const& _linkName,
bool _directorySymlink
)
{
boost::system::error_code symlinkCreationError;
// NOTE: On Windows / works as a separator in a symlink target only if the target is absolute.
// Convert path separators to native ones to avoid this problem.
_targetPath.make_preferred();
if (_directorySymlink)
boost::filesystem::create_directory_symlink(_targetPath, _linkName, symlinkCreationError);
else
+1 -1
View File
@@ -46,7 +46,7 @@ void createFileWithContent(boost::filesystem::path const& _path, std::string con
/// support symlinks.
/// Throws an exception of the operation fails for a different reason.
bool createSymlinkIfSupportedByFilesystem(
boost::filesystem::path const& _targetPath,
boost::filesystem::path _targetPath,
boost::filesystem::path const& _linkName,
bool _directorySymlink
);
+2
View File
@@ -32,6 +32,7 @@
#include <test/libyul/YulInterpreterTest.h>
#include <test/libyul/ObjectCompilerTest.h>
#include <test/libyul/FunctionSideEffects.h>
#include <test/libyul/StackLayoutGeneratorTest.h>
#include <test/libyul/SyntaxTest.h>
#include <boost/filesystem.hpp>
@@ -61,6 +62,7 @@ Testsuite const g_interactiveTestsuites[] = {
{"Yul Interpreter", "libyul", "yulInterpreterTests", false, false, &yul::test::YulInterpreterTest::create},
{"Yul Object Compiler", "libyul", "objectCompiler", false, false, &yul::test::ObjectCompilerTest::create},
{"Yul Control Flow Graph", "libyul", "yulControlFlowGraph", false, false, &yul::test::ControlFlowGraphTest::create},
{"Yul Stack Layout", "libyul", "yulStackLayout", false, false, &yul::test::StackLayoutGeneratorTest::create},
{"Function Side Effects", "libyul", "functionSideEffects", false, false, &yul::test::FunctionSideEffects::create},
{"Yul Syntax", "libyul", "yulSyntaxTests", false, false, &yul::test::SyntaxTest::create},
{"EVM Code Transform", "libyul", "evmCodeTransform", false, false, &yul::test::EVMCodeTransformTest::create, {"nooptions"}},
+19 -15
View File
@@ -24,7 +24,6 @@
#include <iostream>
#include <libsolutil/Assertions.h>
#include <libsolutil/CommonData.h>
#include <libsolutil/JSON.h>
#include <test/Metadata.h>
using namespace std;
@@ -170,30 +169,35 @@ std::optional<map<string, string>> parseCBORMetadata(bytes const& _metadata)
}
}
bool isValidMetadata(string const& _metadata)
bool isValidMetadata(string const& _serialisedMetadata)
{
Json::Value metadata;
if (!util::jsonParseStrict(_metadata, metadata))
if (!util::jsonParseStrict(_serialisedMetadata, metadata))
return false;
return isValidMetadata(metadata);
}
bool isValidMetadata(Json::Value const& _metadata)
{
if (
!metadata.isObject() ||
!metadata.isMember("version") ||
!metadata.isMember("language") ||
!metadata.isMember("compiler") ||
!metadata.isMember("settings") ||
!metadata.isMember("sources") ||
!metadata.isMember("output") ||
!metadata["settings"].isMember("evmVersion") ||
!metadata["settings"].isMember("metadata") ||
!metadata["settings"]["metadata"].isMember("bytecodeHash")
!_metadata.isObject() ||
!_metadata.isMember("version") ||
!_metadata.isMember("language") ||
!_metadata.isMember("compiler") ||
!_metadata.isMember("settings") ||
!_metadata.isMember("sources") ||
!_metadata.isMember("output") ||
!_metadata["settings"].isMember("evmVersion") ||
!_metadata["settings"].isMember("metadata") ||
!_metadata["settings"]["metadata"].isMember("bytecodeHash")
)
return false;
if (!metadata["version"].isNumeric() || metadata["version"] != 1)
if (!_metadata["version"].isNumeric() || _metadata["version"] != 1)
return false;
if (!metadata["language"].isString() || metadata["language"].asString() != "Solidity")
if (!_metadata["language"].isString() || _metadata["language"].asString() != "Solidity")
return false;
/// @TODO add more strict checks
+6 -3
View File
@@ -21,6 +21,7 @@
*/
#include <libsolutil/CommonData.h>
#include <libsolutil/JSON.h>
#include <map>
#include <optional>
@@ -48,8 +49,10 @@ std::string bytecodeSansMetadata(std::string const& _bytecode);
/// - everything else is invalid
std::optional<std::map<std::string, std::string>> parseCBORMetadata(bytes const& _metadata);
/// Expects a serialised metadata JSON and returns true if the
/// content is valid metadata.
bool isValidMetadata(std::string const& _metadata);
/// Expects a serialised metadata JSON and returns true if the content is valid metadata.
bool isValidMetadata(std::string const& _serialisedMetadata);
/// Expects a deserialised metadata JSON and returns true if the content is valid metadata.
bool isValidMetadata(Json::Value const& _metadata);
} // end namespaces
+101 -53
View File
@@ -26,7 +26,7 @@
# (c) 2016 solidity contributors.
#------------------------------------------------------------------------------
set -e
set -eo pipefail
## GLOBAL VARIABLES
@@ -37,8 +37,44 @@ source "${REPO_ROOT}/scripts/common.sh"
# shellcheck source=scripts/common_cmdline.sh
source "${REPO_ROOT}/scripts/common_cmdline.sh"
AUTOUPDATE=false
[[ $1 == --update ]] && AUTOUPDATE=true && shift
pushd "${REPO_ROOT}/test/cmdlineTests" > /dev/null
autoupdate=false
no_smt=false
declare -a selected_tests
declare -a patterns_with_no_matches
while [[ $# -gt 0 ]]
do
case "$1" in
--update)
autoupdate=true
shift
;;
--no-smt)
no_smt=true
shift
;;
*)
matching_tests=$(find . -mindepth 1 -maxdepth 1 -type d -name "$1" | cut --characters 3- | sort)
if [[ $matching_tests == "" ]]
then
patterns_with_no_matches+=("$1")
printWarning "No tests matching pattern '$1' found."
else
# shellcheck disable=SC2206 # We do not support test names containing spaces.
selected_tests+=($matching_tests)
fi
shift
;;
esac
done
if (( ${#selected_tests[@]} == 0 && ${#patterns_with_no_matches[@]} == 0 ))
then
selected_tests=(*)
fi
popd > /dev/null
case "$OSTYPE" in
msys)
@@ -51,7 +87,7 @@ case "$OSTYPE" in
SOLC="${SOLIDITY_BUILD_DIR}/solc/solc"
;;
esac
echo "${SOLC}"
echo "Using solc binary at ${SOLC}"
INTERACTIVE=true
if ! tty -s || [ "$CI" ]
@@ -60,7 +96,8 @@ then
fi
# extend stack size in case we run via ASAN
if [[ -n "${CIRCLECI}" ]] || [[ -n "$CI" ]]; then
if [[ -n "${CIRCLECI}" ]] || [[ -n "$CI" ]]
then
ulimit -s 16384
ulimit -a
fi
@@ -71,6 +108,15 @@ function update_expectation {
local newExpectation="${1}"
local expectationFile="${2}"
if [[ $newExpectation == "" || $newExpectation -eq 0 && $expectationFile == */exit ]]
then
if [[ -f $expectationFile ]]
then
rm "$expectationFile"
fi
return
fi
echo "$newExpectation" > "$expectationFile"
printLog "File $expectationFile updated to match the expectation."
}
@@ -82,7 +128,7 @@ function ask_expectation_update
local newExpectation="${1}"
local expectationFile="${2}"
if [[ $AUTOUPDATE == true ]]
if [[ $autoupdate == true ]]
then
update_expectation "$newExpectation" "$expectationFile"
else
@@ -126,7 +172,10 @@ function test_solc_behaviour()
# shellcheck disable=SC2064
trap "rm -f $stdout_path $stderr_path" EXIT
if [[ "$exit_code_expected" = "" ]]; then exit_code_expected="0"; fi
if [[ "$exit_code_expected" = "" ]]
then
exit_code_expected="0"
fi
[[ $filename == "" ]] || solc_args+=("$filename")
@@ -234,7 +283,7 @@ EOF
[[ $stderr_expectation_file == "" ]] && exit 1
fi
rm -f "$stdout_path" "$stderr_path"
rm "$stdout_path" "$stderr_path"
}
@@ -246,7 +295,7 @@ function test_solc_assembly_output()
local expected_object="object \"object\" { code ${expected} }"
output=$(echo "${input}" | "$SOLC" - "${solc_args[@]}" 2>/dev/null)
output=$(echo "${input}" | msg_on_error --no-stderr "$SOLC" - "${solc_args[@]}")
empty=$(echo "$output" | tr '\n' ' ' | tr -s ' ' | sed -ne "/${expected_object}/p")
if [ -z "$empty" ]
then
@@ -274,8 +323,7 @@ printTask "Testing unknown options..."
then
echo "Passed"
else
printError "Incorrect response to unknown options: $output"
exit 1
fail "Incorrect response to unknown options: $output"
fi
)
@@ -293,25 +341,31 @@ test_solc_behaviour "${0}" "ctx:=/some/remapping/target" "" "" 1 "" "Invalid rem
printTask "Running general commandline tests..."
(
cd "$REPO_ROOT"/test/cmdlineTests/
for tdir in ${*:-*/}
for tdir in "${selected_tests[@]}"
do
if ! [[ -d $tdir ]]; then
if [[ $tdir =~ ^--.*$ ]]; then
if [[ $tdir == "--update" ]]; then
printError "The --update option must be given before any positional arguments."
else
printError "Invalid option: $tdir."
fi
else
printError "Test directory not found: $tdir"
fi
exit 1
if ! [[ -d $tdir ]]
then
fail "Test directory not found: $tdir"
fi
printTask " - ${tdir}"
if [[ $(ls -A "$tdir") == "" ]]
then
printWarning " ---> skipped (test dir empty)"
continue
fi
# Strip trailing slash from $tdir.
tdir=$(basename "${tdir}")
if [[ $no_smt == true ]]
then
if [[ $tdir =~ .*model_checker_.* ]]
then
printWarning " ---> skipped (SMT test)"
continue
fi
fi
inputFiles="$(ls -1 "${tdir}/input."* 2> /dev/null || true)"
inputCount="$(echo "${inputFiles}" | wc -w)"
@@ -327,7 +381,7 @@ printTask "Running general commandline tests..."
if [ "${inputFile}" = "${tdir}/input.json" ]
then
! [ -e "${tdir}/stdin" ] || { printError "Found a file called 'stdin' but redirecting standard input in JSON mode is not allowed."; exit 1; }
! [ -e "${tdir}/stdin" ] || fail "Found a file called 'stdin' but redirecting standard input in JSON mode is not allowed."
stdin="${inputFile}"
inputFile=""
@@ -338,7 +392,7 @@ printTask "Running general commandline tests..."
if [ -e "${tdir}/stdin" ]
then
stdin="${tdir}/stdin"
[ -f "${tdir}/stdin" ] || { printError "'stdin' is not a regular file."; exit 1; }
[ -f "${tdir}/stdin" ] || fail "'stdin' is not a regular file."
else
stdin=""
fi
@@ -415,52 +469,50 @@ SOLTMPDIR=$(mktemp -d)
compileFull "${opts[@]}" "$SOLTMPDIR/$f"
done
)
rm -rf "$SOLTMPDIR"
rm -r "$SOLTMPDIR"
echo "Done."
printTask "Testing library checksum..."
echo '' | "$SOLC" - --link --libraries a=0x90f20564390eAe531E810af625A22f51385Cd222 >/dev/null
echo '' | msg_on_error --no-stdout "$SOLC" - --link --libraries a=0x90f20564390eAe531E810af625A22f51385Cd222
echo '' | "$SOLC" - --link --libraries a=0x80f20564390eAe531E810af625A22f51385Cd222 &>/dev/null && exit 1
printTask "Testing long library names..."
echo '' | "$SOLC" - --link --libraries aveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerylonglibraryname=0x90f20564390eAe531E810af625A22f51385Cd222 >/dev/null
echo '' | msg_on_error --no-stdout "$SOLC" - --link --libraries aveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerylonglibraryname=0x90f20564390eAe531E810af625A22f51385Cd222
printTask "Testing linking itself..."
SOLTMPDIR=$(mktemp -d)
(
cd "$SOLTMPDIR"
set -e
echo 'library L { function f() public pure {} } contract C { function f() public pure { L.f(); } }' > x.sol
"$SOLC" --bin -o . x.sol 2>/dev/null
msg_on_error --no-stderr "$SOLC" --bin -o . x.sol
# Explanation and placeholder should be there
grep -q '//' C.bin && grep -q '__' C.bin
# But not in library file.
grep -q -v '[/_]' L.bin
# Now link
"$SOLC" --link --libraries x.sol:L=0x90f20564390eAe531E810af625A22f51385Cd222 C.bin
msg_on_error "$SOLC" --link --libraries x.sol:L=0x90f20564390eAe531E810af625A22f51385Cd222 C.bin
# Now the placeholder and explanation should be gone.
grep -q -v '[/_]' C.bin
)
rm -rf "$SOLTMPDIR"
rm -r "$SOLTMPDIR"
printTask "Testing overwriting files..."
SOLTMPDIR=$(mktemp -d)
(
set -e
# First time it works
echo 'contract C {} ' | "$SOLC" - --bin -o "$SOLTMPDIR/non-existing-stuff-to-create" 2>/dev/null
echo 'contract C {}' | msg_on_error --no-stderr "$SOLC" - --bin -o "$SOLTMPDIR/non-existing-stuff-to-create"
# Second time it fails
echo 'contract C {} ' | "$SOLC" - --bin -o "$SOLTMPDIR/non-existing-stuff-to-create" 2>/dev/null && exit 1
echo 'contract C {}' | "$SOLC" - --bin -o "$SOLTMPDIR/non-existing-stuff-to-create" 2>/dev/null && exit 1
# Unless we force
echo 'contract C {} ' | "$SOLC" - --overwrite --bin -o "$SOLTMPDIR/non-existing-stuff-to-create" 2>/dev/null
echo 'contract C {}' | msg_on_error --no-stderr "$SOLC" - --overwrite --bin -o "$SOLTMPDIR/non-existing-stuff-to-create"
)
rm -rf "$SOLTMPDIR"
rm -r "$SOLTMPDIR"
printTask "Testing assemble, yul, strict-assembly and optimize..."
(
echo '{}' | "$SOLC" - --assemble &>/dev/null
echo '{}' | "$SOLC" - --yul &>/dev/null
echo '{}' | "$SOLC" - --strict-assembly &>/dev/null
echo '{}' | msg_on_error --silent "$SOLC" - --assemble
echo '{}' | msg_on_error --silent "$SOLC" - --yul
echo '{}' | msg_on_error --silent "$SOLC" - --strict-assembly
# Test options above in conjunction with --optimize.
# Using both, --assemble and --optimize should fail.
@@ -482,31 +534,27 @@ printTask "Testing standard input..."
SOLTMPDIR=$(mktemp -d)
(
set +e
output=$("$SOLC" --bin 2>&1)
output=$("$SOLC" --bin 2>&1)
result=$?
set -e
# This should fail
if [[ ! ("$output" =~ "No input files given") || ($result == 0) ]]
then
printError "Incorrect response to empty input arg list: $output"
exit 1
fail "Incorrect response to empty input arg list: $output"
fi
# The contract should be compiled
if ! output=$(echo 'contract C {} ' | "$SOLC" - --bin 2>/dev/null | grep -q "<stdin>:C")
if ! echo 'contract C {}' | msg_on_error --no-stderr "$SOLC" - --bin | grep -q "<stdin>:C"
then
printError "Failed to compile a simple contract from standard input"
exit 1
fail "Failed to compile a simple contract from standard input"
fi
# This should not fail
if ! output=$(echo '' | "$SOLC" --ast-compact-json - 2>/dev/null)
then
printError "Incorrect response to --ast-compact-json option with empty stdin"
exit 1
fi
echo '' | msg_on_error --silent --msg "Incorrect response to --ast-compact-json option with empty stdin" \
"$SOLC" --ast-compact-json -
)
rm -r "$SOLTMPDIR"
printTask "Testing AST import..."
SOLTMPDIR=$(mktemp -d)
@@ -518,7 +566,7 @@ SOLTMPDIR=$(mktemp -d)
exit 1
fi
)
rm -rf "$SOLTMPDIR"
rm -r "$SOLTMPDIR"
printTask "Testing AST export with stop-after=parsing..."
"$REPO_ROOT/test/stopAfterParseTests.sh"
@@ -534,6 +582,6 @@ SOLTMPDIR=$(mktemp -d)
echo ./*.sol | xargs -P 4 -n 50 "${SOLIDITY_BUILD_DIR}/test/tools/solfuzzer" --quiet --input-files
echo ./*.sol | xargs -P 4 -n 50 "${SOLIDITY_BUILD_DIR}/test/tools/solfuzzer" --without-optimizer --quiet --input-files
)
rm -rf "$SOLTMPDIR"
rm -r "$SOLTMPDIR"
echo "Commandline tests successful."
+1
View File
@@ -0,0 +1 @@
--asm-json
+9
View File
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract C {
function f(uint x) public pure {
x += 42;
require(x > 100);
}
}
File diff suppressed because it is too large Load Diff
@@ -30,6 +30,7 @@ JSON AST (compact format):
{
"abstract": false,
"baseContracts": [],
"canonicalName": "C",
"contractDependencies": [],
"contractKind": "contract",
"fullyImplemented": true,
@@ -1 +1 @@
--evm-version=homestead --import-ast --combined-json ast,compact-format --pretty-json
--evm-version=homestead --import-ast --combined-json ast --pretty-json
File diff suppressed because it is too large Load Diff
@@ -1 +1 @@
{"contracts":{"combined_json_with_base_path/c.sol:C":{}},"sourceList":["combined_json_with_base_path/c.sol","combined_json_with_base_path/input.sol"],"sources":{"combined_json_with_base_path/c.sol":{"AST":{"absolutePath":"combined_json_with_base_path/c.sol","exportedSymbols":{"C":[5]},"id":6,"license":"GPL-3.0","nodeType":"SourceUnit","nodes":[{"id":4,"literals":["solidity",">=","0.0"],"nodeType":"PragmaDirective","src":"36:22:0"},{"abstract":false,"baseContracts":[],"contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"id":5,"linearizedBaseContracts":[5],"name":"C","nameLocation":"69:1:0","nodeType":"ContractDefinition","nodes":[],"scope":6,"src":"60:13:0","usedErrors":[]}],"src":"36:38:0"}},"combined_json_with_base_path/input.sol":{"AST":{"absolutePath":"combined_json_with_base_path/input.sol","exportedSymbols":{"C":[5]},"id":3,"license":"GPL-3.0","nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.0"],"nodeType":"PragmaDirective","src":"36:22:1"},{"absolutePath":"combined_json_with_base_path/c.sol","file":"./c.sol","id":2,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":3,"sourceUnit":6,"src":"60:17:1","symbolAliases":[],"unitAlias":""}],"src":"36:42:1"}}},"version": "<VERSION REMOVED>"}
{"contracts":{"combined_json_with_base_path/c.sol:C":{}},"sourceList":["combined_json_with_base_path/c.sol","combined_json_with_base_path/input.sol"],"sources":{"combined_json_with_base_path/c.sol":{"AST":{"absolutePath":"combined_json_with_base_path/c.sol","exportedSymbols":{"C":[5]},"id":6,"license":"GPL-3.0","nodeType":"SourceUnit","nodes":[{"id":4,"literals":["solidity",">=","0.0"],"nodeType":"PragmaDirective","src":"36:22:0"},{"abstract":false,"baseContracts":[],"canonicalName":"C","contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"id":5,"linearizedBaseContracts":[5],"name":"C","nameLocation":"69:1:0","nodeType":"ContractDefinition","nodes":[],"scope":6,"src":"60:13:0","usedErrors":[]}],"src":"36:38:0"}},"combined_json_with_base_path/input.sol":{"AST":{"absolutePath":"combined_json_with_base_path/input.sol","exportedSymbols":{"C":[5]},"id":3,"license":"GPL-3.0","nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.0"],"nodeType":"PragmaDirective","src":"36:22:1"},{"absolutePath":"combined_json_with_base_path/c.sol","file":"./c.sol","id":2,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":3,"sourceUnit":6,"src":"60:17:1","symbolAliases":[],"unitAlias":""}],"src":"36:42:1"}}},"version": "<VERSION REMOVED>"}
@@ -6,30 +6,31 @@ Optimized IR:
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"constant_optimizer_yul/input.sol", 1:"#utility.yul"
/// @use-src 0:"constant_optimizer_yul/input.sol"
object "C_12" {
code {
{
/// @src 0:61:418
/// @src 0:61:418 "contract C {..."
mstore(64, 128)
if callvalue() { revert(0, 0) }
/// @src 0:103:238
/// @src 0:103:238 "assembly {..."
sstore(0, shl(180, 1))
/// @src 0:61:418
/// @src 0:61:418 "contract C {..."
let _1 := datasize("C_12_deployed")
codecopy(128, dataoffset("C_12_deployed"), _1)
return(128, _1)
}
}
/// @use-src 0:"constant_optimizer_yul/input.sol"
object "C_12_deployed" {
code {
{
/// @src 0:61:418
/// @src 0:61:418 "contract C {..."
mstore(64, 128)
if callvalue() { revert(0, 0) }
/// @src 0:279:410
/// @src 0:279:410 "assembly {..."
sstore(0, 0x1000000000000000000000000000000000000000000000)
/// @src 0:61:418
/// @src 0:61:418 "contract C {..."
stop()
}
}
@@ -0,0 +1 @@
--ir-optimized --ir --optimize
@@ -0,0 +1,13 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0.0;
// Intentionally badly wrapped and commented in weird places to get source locations inside code
// snippets in generated Yul. Also contains stuff that could break the assembly if not escaped properly.
contract C {} contract D /** @src 0:96:165 "contract D {..." */ {
function f() /* @use-src 0:"input.sol", 1:"#utility.yul" @ast-id 15 */ public returns (string memory) { C c = new /// @src 0:149:156 "new C()"
C(); c;
string memory s = "/*"; s; return "/** @src 0:96:165 \"contract D {...\" */"
;
}
}
@@ -0,0 +1,579 @@
IR:
/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol"
object "C_2" {
code {
/// @src 0:265:278 "contract C {}"
mstore(64, 128)
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
constructor_C_2()
let _1 := allocate_unbounded()
codecopy(_1, dataoffset("C_2_deployed"), datasize("C_2_deployed"))
return(_1, datasize("C_2_deployed"))
function allocate_unbounded() -> memPtr {
memPtr := mload(64)
}
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
revert(0, 0)
}
/// @src 0:265:278 "contract C {}"
function constructor_C_2() {
/// @src 0:265:278 "contract C {}"
}
/// @src 0:265:278 "contract C {}"
}
/// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol"
object "C_2_deployed" {
code {
/// @src 0:265:278 "contract C {}"
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let selector := shift_right_224_unsigned(calldataload(0))
switch selector
default {}
}
if iszero(calldatasize()) { }
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
function shift_right_224_unsigned(value) -> newValue {
newValue :=
shr(224, value)
}
function allocate_unbounded() -> memPtr {
memPtr := mload(64)
}
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
revert(0, 0)
}
}
data ".metadata" hex"<BYTECODE REMOVED>"
}
}
Optimized IR:
/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol"
object "C_2" {
code {
{
/// @src 0:265:278 "contract C {}"
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("C_2_deployed")
codecopy(128, dataoffset("C_2_deployed"), _1)
return(128, _1)
}
}
/// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol"
object "C_2_deployed" {
code {
{
/// @src 0:265:278 "contract C {}"
mstore(64, 128)
revert(0, 0)
}
}
data ".metadata" hex"<BYTECODE REMOVED>"
}
}
IR:
/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol"
object "D_27" {
code {
/// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..."
mstore(64, 128)
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
constructor_D_27()
let _1 := allocate_unbounded()
codecopy(_1, dataoffset("D_27_deployed"), datasize("D_27_deployed"))
return(_1, datasize("D_27_deployed"))
function allocate_unbounded() -> memPtr {
memPtr := mload(64)
}
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
revert(0, 0)
}
/// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..."
function constructor_D_27() {
/// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..."
}
/// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..."
}
/// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol"
object "D_27_deployed" {
code {
/// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..."
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let selector := shift_right_224_unsigned(calldataload(0))
switch selector
case 0x26121ff0
{
// f()
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
abi_decode_tuple_(4, calldatasize())
let ret_0 := fun_f_26()
let memPos := allocate_unbounded()
let memEnd := abi_encode_tuple_t_string_memory_ptr__to_t_string_memory_ptr__fromStack(memPos , ret_0)
return(memPos, sub(memEnd, memPos))
}
default {}
}
if iszero(calldatasize()) { }
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
function shift_right_224_unsigned(value) -> newValue {
newValue :=
shr(224, value)
}
function allocate_unbounded() -> memPtr {
memPtr := mload(64)
}
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
revert(0, 0)
}
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {
revert(0, 0)
}
function abi_decode_tuple_(headStart, dataEnd) {
if slt(sub(dataEnd, headStart), 0) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
}
function array_length_t_string_memory_ptr(value) -> length {
length := mload(value)
}
function array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length) -> updated_pos {
mstore(pos, length)
updated_pos := add(pos, 0x20)
}
function copy_memory_to_memory(src, dst, length) {
let i := 0
for { } lt(i, length) { i := add(i, 32) }
{
mstore(add(dst, i), mload(add(src, i)))
}
if gt(i, length)
{
// clear end
mstore(add(dst, length), 0)
}
}
function round_up_to_mul_of_32(value) -> result {
result := and(add(value, 31), not(31))
}
function abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack(value, pos) -> end {
let length := array_length_t_string_memory_ptr(value)
pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length)
copy_memory_to_memory(add(value, 0x20), pos, length)
end := add(pos, round_up_to_mul_of_32(length))
}
function abi_encode_tuple_t_string_memory_ptr__to_t_string_memory_ptr__fromStack(headStart , value0) -> tail {
tail := add(headStart, 32)
mstore(add(headStart, 0), sub(tail, headStart))
tail := abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack(value0, tail)
}
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
revert(0, 0)
}
function zero_value_for_split_t_string_memory_ptr() -> ret {
ret := 96
}
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function abi_encode_tuple__to__fromStack(headStart ) -> tail {
tail := add(headStart, 0)
}
function revert_forward_1() {
let pos := allocate_unbounded()
returndatacopy(pos, 0, returndatasize())
revert(pos, returndatasize())
}
function finalize_allocation(memPtr, size) {
let newFreePtr := add(memPtr, round_up_to_mul_of_32(size))
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
function allocate_memory(size) -> memPtr {
memPtr := allocate_unbounded()
finalize_allocation(memPtr, size)
}
function array_allocation_size_t_string_memory_ptr(length) -> size {
// Make sure we can allocate memory without overflow
if gt(length, 0xffffffffffffffff) { panic_error_0x41() }
size := round_up_to_mul_of_32(length)
// add length slot
size := add(size, 0x20)
}
function allocate_memory_array_t_string_memory_ptr(length) -> memPtr {
let allocSize := array_allocation_size_t_string_memory_ptr(length)
memPtr := allocate_memory(allocSize)
mstore(memPtr, length)
}
function store_literal_in_memory_c077635d0709aa1fd7cea2045028c270f982d687d1647e48e759eec32ec54a50(memPtr) {
mstore(add(memPtr, 0), "/*")
}
function copy_literal_to_memory_c077635d0709aa1fd7cea2045028c270f982d687d1647e48e759eec32ec54a50() -> memPtr {
memPtr := allocate_memory_array_t_string_memory_ptr(2)
store_literal_in_memory_c077635d0709aa1fd7cea2045028c270f982d687d1647e48e759eec32ec54a50(add(memPtr, 32))
}
function convert_t_stringliteral_c077635d0709aa1fd7cea2045028c270f982d687d1647e48e759eec32ec54a50_to_t_string_memory_ptr() -> converted {
converted := copy_literal_to_memory_c077635d0709aa1fd7cea2045028c270f982d687d1647e48e759eec32ec54a50()
}
function store_literal_in_memory_5bde9a896e3f09acac1496d16642fcdd887d2a000bf1ab18bdff3f17b91e320b(memPtr) {
mstore(add(memPtr, 0), 0x2f2a2a204073726320303a39363a313635202022636f6e74726163742044207b)
mstore(add(memPtr, 32), 0x2e2e2e22202a2f00000000000000000000000000000000000000000000000000)
}
function copy_literal_to_memory_5bde9a896e3f09acac1496d16642fcdd887d2a000bf1ab18bdff3f17b91e320b() -> memPtr {
memPtr := allocate_memory_array_t_string_memory_ptr(39)
store_literal_in_memory_5bde9a896e3f09acac1496d16642fcdd887d2a000bf1ab18bdff3f17b91e320b(add(memPtr, 32))
}
function convert_t_stringliteral_5bde9a896e3f09acac1496d16642fcdd887d2a000bf1ab18bdff3f17b91e320b_to_t_string_memory_ptr() -> converted {
converted := copy_literal_to_memory_5bde9a896e3f09acac1496d16642fcdd887d2a000bf1ab18bdff3f17b91e320b()
}
/// @ast-id 26
/// @src 0:336:597 "function f() /* @use-src 0:\"input.sol\", 1:\"#utility.yul\" @ast-id 15 *\/ public returns (string memory) { C c = new /// @src 0:149:156 \"new C()\"..."
function fun_f_26() -> var__5_mpos {
/// @src 0:423:436 "string memory"
let zero_t_string_memory_ptr_1_mpos := zero_value_for_split_t_string_memory_ptr()
var__5_mpos := zero_t_string_memory_ptr_1_mpos
/// @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..."
let _2 := allocate_unbounded()
let _3 := add(_2, datasize("C_2"))
if or(gt(_3, 0xffffffffffffffff), lt(_3, _2)) { panic_error_0x41() }
datacopy(_2, dataoffset("C_2"), datasize("C_2"))
_3 := abi_encode_tuple__to__fromStack(_3)
let expr_13_address := create(0, _2, sub(_3, _2))
if iszero(expr_13_address) { revert_forward_1() }
/// @src 0:440:491 "C c = new /// @src 0:149:156 \"new C()\"..."
let var_c_9_address := expr_13_address
/// @src 0:493:494 "c"
let _4_address := var_c_9_address
let expr_15_address := _4_address
/// @src 0:504:526 "string memory s = \"/*\""
let var_s_18_mpos := convert_t_stringliteral_c077635d0709aa1fd7cea2045028c270f982d687d1647e48e759eec32ec54a50_to_t_string_memory_ptr()
/// @src 0:528:529 "s"
let _5_mpos := var_s_18_mpos
let expr_21_mpos := _5_mpos
/// @src 0:531:581 "return \"/** @src 0:96:165 \\\"contract D {...\\\" *\/\""
var__5_mpos := convert_t_stringliteral_5bde9a896e3f09acac1496d16642fcdd887d2a000bf1ab18bdff3f17b91e320b_to_t_string_memory_ptr()
leave
}
/// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..."
}
/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol"
object "C_2" {
code {
/// @src 0:265:278 "contract C {}"
mstore(64, 128)
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
constructor_C_2()
let _1 := allocate_unbounded()
codecopy(_1, dataoffset("C_2_deployed"), datasize("C_2_deployed"))
return(_1, datasize("C_2_deployed"))
function allocate_unbounded() -> memPtr {
memPtr := mload(64)
}
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
revert(0, 0)
}
/// @src 0:265:278 "contract C {}"
function constructor_C_2() {
/// @src 0:265:278 "contract C {}"
}
/// @src 0:265:278 "contract C {}"
}
/// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol"
object "C_2_deployed" {
code {
/// @src 0:265:278 "contract C {}"
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let selector := shift_right_224_unsigned(calldataload(0))
switch selector
default {}
}
if iszero(calldatasize()) { }
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
function shift_right_224_unsigned(value) -> newValue {
newValue :=
shr(224, value)
}
function allocate_unbounded() -> memPtr {
memPtr := mload(64)
}
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
revert(0, 0)
}
}
data ".metadata" hex"<BYTECODE REMOVED>"
}
}
data ".metadata" hex"<BYTECODE REMOVED>"
}
}
Optimized IR:
/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol"
object "D_27" {
code {
{
/// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..."
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("D_27_deployed")
codecopy(128, dataoffset("D_27_deployed"), _1)
return(128, _1)
}
}
/// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol"
object "D_27_deployed" {
code {
{
/// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..."
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let _1 := 0
if eq(0x26121ff0, shr(224, calldataload(_1)))
{
if callvalue() { revert(_1, _1) }
if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) }
/// @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..."
let _2 := datasize("C_2")
let _3 := add(/** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ 128, /** @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..." */ _2)
if or(gt(_3, 0xffffffffffffffff), lt(_3, /** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ 128))
/// @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..."
{ panic_error_0x41() }
datacopy(/** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ 128, /** @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..." */ dataoffset("C_2"), _2)
if iszero(create(/** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ _1, 128, /** @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..." */ _2))
{
/// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..."
let pos := mload(64)
returndatacopy(pos, _1, returndatasize())
revert(pos, returndatasize())
}
mstore(add(allocate_memory_array_string(), 32), "/*")
let memPtr := allocate_memory_array_string_482()
mstore(add(memPtr, 32), 0x2f2a2a204073726320303a39363a313635202022636f6e74726163742044207b)
mstore(add(memPtr, 64), shl(200, 0x2e2e2e22202a2f))
let memPos := mload(64)
return(memPos, sub(abi_encode_string(memPos, memPtr), memPos))
}
}
revert(0, 0)
}
function abi_encode_string(headStart, value0) -> tail
{
let _1 := 32
mstore(headStart, _1)
let length := mload(value0)
mstore(add(headStart, _1), length)
let i := 0
for { } lt(i, length) { i := add(i, _1) }
{
mstore(add(add(headStart, i), 64), mload(add(add(value0, i), _1)))
}
if gt(i, length)
{
mstore(add(add(headStart, length), 64), 0)
}
tail := add(add(headStart, and(add(length, 31), not(31))), 64)
}
function panic_error_0x41()
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x41)
revert(0, 0x24)
}
function allocate_memory_array_string() -> memPtr
{
let memPtr_1 := mload(64)
let newFreePtr := add(memPtr_1, 64)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr_1)) { panic_error_0x41() }
mstore(64, newFreePtr)
memPtr := memPtr_1
mstore(memPtr_1, 2)
}
function allocate_memory_array_string_482() -> memPtr
{
let memPtr_1 := mload(64)
let newFreePtr := add(memPtr_1, 96)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr_1)) { panic_error_0x41() }
mstore(64, newFreePtr)
memPtr := memPtr_1
mstore(memPtr_1, 39)
}
}
/// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol"
object "C_2" {
code {
{
/// @src 0:265:278 "contract C {}"
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("C_2_deployed")
codecopy(128, dataoffset("C_2_deployed"), _1)
return(128, _1)
}
}
/// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol"
object "C_2_deployed" {
code {
{
/// @src 0:265:278 "contract C {}"
mstore(64, 128)
revert(0, 0)
}
}
data ".metadata" hex"<BYTECODE REMOVED>"
}
}
data ".metadata" hex"<BYTECODE REMOVED>"
}
}
+168 -166
View File
@@ -7,10 +7,10 @@ IR:
*=====================================================*/
/// @use-src 0:"exp_base_literal/input.sol", 1:"#utility.yul"
/// @use-src 0:"exp_base_literal/input.sol"
object "C_81" {
code {
/// @src 0:82:370
/// @src 0:82:370 "contract C {..."
mstore(64, 128)
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
@@ -25,22 +25,23 @@ object "C_81" {
memPtr := mload(64)
}
/// @src 0:82:370
function constructor_C_81() {
/// @src 0:82:370
}
/// @src 0:82:370
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
revert(0, 0)
}
/// @src 0:82:370 "contract C {..."
function constructor_C_81() {
/// @src 0:82:370 "contract C {..."
}
/// @src 0:82:370 "contract C {..."
}
/// @use-src 0:"exp_base_literal/input.sol"
object "C_81_deployed" {
code {
/// @src 0:82:370
/// @src 0:82:370 "contract C {..."
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
@@ -65,6 +66,37 @@ object "C_81" {
if iszero(calldatasize()) { }
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
function shift_right_224_unsigned(value) -> newValue {
newValue :=
shr(224, value)
}
function allocate_unbounded() -> memPtr {
memPtr := mload(64)
}
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
revert(0, 0)
}
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {
revert(0, 0)
}
function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {
revert(0, 0)
}
function cleanup_t_uint256(value) -> cleaned {
cleaned := value
}
function validator_revert_t_uint256(value) {
if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }
}
function abi_decode_t_uint256(offset, end) -> value {
value := calldataload(offset)
validator_revert_t_uint256(value)
@@ -103,14 +135,18 @@ object "C_81" {
}
function abi_encode_t_int256_to_t_int256_fromStack(value, pos) {
mstore(pos, cleanup_t_int256(value))
}
function abi_encode_t_uint256_to_t_uint256_fromStack(value, pos) {
mstore(pos, cleanup_t_uint256(value))
}
function cleanup_t_int256(value) -> cleaned {
cleaned := value
}
function abi_encode_t_int256_to_t_int256_fromStack(value, pos) {
mstore(pos, cleanup_t_int256(value))
}
function abi_encode_tuple_t_uint256_t_int256_t_uint256_t_uint256__to_t_uint256_t_int256_t_uint256_t_uint256__fromStack(headStart , value0, value1, value2, value3) -> tail {
tail := add(headStart, 128)
@@ -124,36 +160,34 @@ object "C_81" {
}
function allocate_unbounded() -> memPtr {
memPtr := mload(64)
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
revert(0, 0)
}
function checked_exp_t_rational_0_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
power := exp(0, exponent)
function zero_value_for_split_t_uint256() -> ret {
ret := 0
}
function checked_exp_t_rational_10_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
if gt(exponent, 77) { panic_error_0x11() }
power := exp(10, exponent)
function zero_value_for_split_t_int256() -> ret {
ret := 0
}
function checked_exp_t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
if gt(exponent, 1) { panic_error_0x11() }
power := exp(115792089237316195423570985008687907853269984665640564039457584007913129639935, exponent)
function cleanup_t_rational_2_by_1(value) -> cleaned {
cleaned := value
}
function checked_exp_t_rational_1_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
function identity(value) -> ret {
ret := value
}
power := exp(1, exponent)
function convert_t_rational_2_by_1_to_t_uint256(value) -> converted {
converted := cleanup_t_uint256(identity(cleanup_t_rational_2_by_1(value)))
}
function panic_error_0x11() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x11)
revert(0, 0x24)
}
function checked_exp_t_rational_2_by_1_t_uint256(exponent) -> power {
@@ -164,10 +198,12 @@ object "C_81" {
power := exp(2, exponent)
}
function checked_exp_t_rational_minus_1_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
function cleanup_t_rational_minus_2_by_1(value) -> cleaned {
cleaned := value
}
power := exp(115792089237316195423570985008687907853269984665640564039457584007913129639935, exponent)
function convert_t_rational_minus_2_by_1_to_t_int256(value) -> converted {
converted := cleanup_t_int256(identity(cleanup_t_rational_minus_2_by_1(value)))
}
function checked_exp_t_rational_minus_2_by_1_t_uint256(exponent) -> power {
@@ -178,39 +214,39 @@ object "C_81" {
power := exp(115792089237316195423570985008687907853269984665640564039457584007913129639934, exponent)
}
function cleanup_t_int256(value) -> cleaned {
cleaned := value
}
function cleanup_t_rational_0_by_1(value) -> cleaned {
cleaned := value
}
function cleanup_t_rational_10_by_1(value) -> cleaned {
cleaned := value
}
function convert_t_rational_10_by_1_to_t_uint256(value) -> converted {
converted := cleanup_t_uint256(identity(cleanup_t_rational_10_by_1(value)))
}
function checked_exp_t_rational_10_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
if gt(exponent, 77) { panic_error_0x11() }
power := exp(10, exponent)
}
function cleanup_t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1(value) -> cleaned {
cleaned := value
}
function cleanup_t_rational_1_by_1(value) -> cleaned {
cleaned := value
function convert_t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1_to_t_uint256(value) -> converted {
converted := cleanup_t_uint256(identity(cleanup_t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1(value)))
}
function cleanup_t_rational_2_by_1(value) -> cleaned {
cleaned := value
function checked_exp_t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
if gt(exponent, 1) { panic_error_0x11() }
power := exp(115792089237316195423570985008687907853269984665640564039457584007913129639935, exponent)
}
function cleanup_t_rational_minus_1_by_1(value) -> cleaned {
cleaned := value
}
function cleanup_t_rational_minus_2_by_1(value) -> cleaned {
cleaned := value
}
function cleanup_t_uint256(value) -> cleaned {
function cleanup_t_rational_0_by_1(value) -> cleaned {
cleaned := value
}
@@ -218,147 +254,158 @@ object "C_81" {
converted := cleanup_t_uint256(identity(cleanup_t_rational_0_by_1(value)))
}
function convert_t_rational_10_by_1_to_t_uint256(value) -> converted {
converted := cleanup_t_uint256(identity(cleanup_t_rational_10_by_1(value)))
function checked_exp_t_rational_0_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
power := exp(0, exponent)
}
function convert_t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1_to_t_uint256(value) -> converted {
converted := cleanup_t_uint256(identity(cleanup_t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1(value)))
}
function convert_t_rational_1_by_1_to_t_uint256(value) -> converted {
converted := cleanup_t_uint256(identity(cleanup_t_rational_1_by_1(value)))
}
function convert_t_rational_2_by_1_to_t_uint256(value) -> converted {
converted := cleanup_t_uint256(identity(cleanup_t_rational_2_by_1(value)))
function cleanup_t_rational_minus_1_by_1(value) -> cleaned {
cleaned := value
}
function convert_t_rational_minus_1_by_1_to_t_int256(value) -> converted {
converted := cleanup_t_int256(identity(cleanup_t_rational_minus_1_by_1(value)))
}
function convert_t_rational_minus_2_by_1_to_t_int256(value) -> converted {
converted := cleanup_t_int256(identity(cleanup_t_rational_minus_2_by_1(value)))
function checked_exp_t_rational_minus_1_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
power := exp(115792089237316195423570985008687907853269984665640564039457584007913129639935, exponent)
}
/// @src 0:96:368
function cleanup_t_rational_1_by_1(value) -> cleaned {
cleaned := value
}
function convert_t_rational_1_by_1_to_t_uint256(value) -> converted {
converted := cleanup_t_uint256(identity(cleanup_t_rational_1_by_1(value)))
}
function checked_exp_t_rational_1_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
power := exp(1, exponent)
}
/// @ast-id 80
/// @src 0:96:368 "function f(uint a, uint b, uint c, uint d) public pure returns (uint, int, uint, uint) {..."
function fun_f_80(var_a_4, var_b_6, var_c_8, var_d_10) -> var__13, var__15, var__17, var__19 {
/// @src 0:160:164
/// @src 0:160:164 "uint"
let zero_t_uint256_1 := zero_value_for_split_t_uint256()
var__13 := zero_t_uint256_1
/// @src 0:166:169
/// @src 0:166:169 "int"
let zero_t_int256_2 := zero_value_for_split_t_int256()
var__15 := zero_t_int256_2
/// @src 0:171:175
/// @src 0:171:175 "uint"
let zero_t_uint256_3 := zero_value_for_split_t_uint256()
var__17 := zero_t_uint256_3
/// @src 0:177:181
/// @src 0:177:181 "uint"
let zero_t_uint256_4 := zero_value_for_split_t_uint256()
var__19 := zero_t_uint256_4
/// @src 0:196:197
/// @src 0:196:197 "2"
let expr_23 := 0x02
/// @src 0:199:200
/// @src 0:199:200 "a"
let _5 := var_a_4
let expr_24 := _5
/// @src 0:196:200
/// @src 0:196:200 "2**a"
let _6 := convert_t_rational_2_by_1_to_t_uint256(expr_23)
let expr_25 := checked_exp_t_rational_2_by_1_t_uint256(expr_24)
/// @src 0:187:200
/// @src 0:187:200 "uint w = 2**a"
let var_w_22 := expr_25
/// @src 0:213:215
/// @src 0:213:215 "-2"
let expr_30 := 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe
/// @src 0:212:216
/// @src 0:212:216 "(-2)"
let expr_31 := expr_30
/// @src 0:218:219
/// @src 0:218:219 "b"
let _7 := var_b_6
let expr_32 := _7
/// @src 0:212:219
/// @src 0:212:219 "(-2)**b"
let _8 := convert_t_rational_minus_2_by_1_to_t_int256(expr_31)
let expr_33 := checked_exp_t_rational_minus_2_by_1_t_uint256(expr_32)
/// @src 0:204:219
/// @src 0:204:219 "int x = (-2)**b"
let var_x_28 := expr_33
/// @src 0:232:234
/// @src 0:232:234 "10"
let expr_37 := 0x0a
/// @src 0:236:237
/// @src 0:236:237 "c"
let _9 := var_c_8
let expr_38 := _9
/// @src 0:232:237
/// @src 0:232:237 "10**c"
let _10 := convert_t_rational_10_by_1_to_t_uint256(expr_37)
let expr_39 := checked_exp_t_rational_10_by_1_t_uint256(expr_38)
/// @src 0:223:237
/// @src 0:223:237 "uint y = 10**c"
let var_y_36 := expr_39
/// @src 0:251:260
/// @src 0:251:260 "2**256 -1"
let expr_47 := 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
/// @src 0:250:262
/// @src 0:250:262 "(2**256 -1 )"
let expr_48 := expr_47
/// @src 0:264:265
/// @src 0:264:265 "d"
let _11 := var_d_10
let expr_49 := _11
/// @src 0:250:265
/// @src 0:250:265 "(2**256 -1 )**d"
let _12 := convert_t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1_to_t_uint256(expr_48)
let expr_50 := checked_exp_t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1_t_uint256(expr_49)
/// @src 0:241:265
/// @src 0:241:265 "uint z = (2**256 -1 )**d"
let var_z_42 := expr_50
/// @src 0:308:309
/// @src 0:308:309 "0"
let expr_53 := 0x00
/// @src 0:307:310
/// @src 0:307:310 "(0)"
let expr_54 := expr_53
/// @src 0:312:313
/// @src 0:312:313 "a"
let _13 := var_a_4
let expr_55 := _13
/// @src 0:307:313
/// @src 0:307:313 "(0)**a"
let _14 := convert_t_rational_0_by_1_to_t_uint256(expr_54)
let expr_56 := checked_exp_t_rational_0_by_1_t_uint256(expr_55)
/// @src 0:303:313
/// @src 0:303:313 "w = (0)**a"
var_w_22 := expr_56
let expr_57 := expr_56
/// @src 0:322:324
/// @src 0:322:324 "-1"
let expr_61 := 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
/// @src 0:321:325
/// @src 0:321:325 "(-1)"
let expr_62 := expr_61
/// @src 0:327:328
/// @src 0:327:328 "b"
let _15 := var_b_6
let expr_63 := _15
/// @src 0:321:328
/// @src 0:321:328 "(-1)**b"
let _16 := convert_t_rational_minus_1_by_1_to_t_int256(expr_62)
let expr_64 := checked_exp_t_rational_minus_1_by_1_t_uint256(expr_63)
/// @src 0:317:328
/// @src 0:317:328 "x = (-1)**b"
var_x_28 := expr_64
let expr_65 := expr_64
/// @src 0:336:337
/// @src 0:336:337 "1"
let expr_68 := 0x01
/// @src 0:339:340
/// @src 0:339:340 "c"
let _17 := var_c_8
let expr_69 := _17
/// @src 0:336:340
/// @src 0:336:340 "1**c"
let _18 := convert_t_rational_1_by_1_to_t_uint256(expr_68)
let expr_70 := checked_exp_t_rational_1_by_1_t_uint256(expr_69)
/// @src 0:332:340
/// @src 0:332:340 "y = 1**c"
var_y_36 := expr_70
let expr_71 := expr_70
/// @src 0:353:354
/// @src 0:353:354 "w"
let _19 := var_w_22
let expr_73 := _19
/// @src 0:352:364
/// @src 0:352:364 "(w, x, y, z)"
let expr_77_component_1 := expr_73
/// @src 0:356:357
/// @src 0:356:357 "x"
let _20 := var_x_28
let expr_74 := _20
/// @src 0:352:364
/// @src 0:352:364 "(w, x, y, z)"
let expr_77_component_2 := expr_74
/// @src 0:359:360
/// @src 0:359:360 "y"
let _21 := var_y_36
let expr_75 := _21
/// @src 0:352:364
/// @src 0:352:364 "(w, x, y, z)"
let expr_77_component_3 := expr_75
/// @src 0:362:363
/// @src 0:362:363 "z"
let _22 := var_z_42
let expr_76 := _22
/// @src 0:352:364
/// @src 0:352:364 "(w, x, y, z)"
let expr_77_component_4 := expr_76
/// @src 0:345:364
/// @src 0:345:364 "return (w, x, y, z)"
var__13 := expr_77_component_1
var__15 := expr_77_component_2
var__17 := expr_77_component_3
@@ -366,52 +413,7 @@ object "C_81" {
leave
}
/// @src 0:82:370
function identity(value) -> ret {
ret := value
}
function panic_error_0x11() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x11)
revert(0, 0x24)
}
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
revert(0, 0)
}
function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {
revert(0, 0)
}
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
revert(0, 0)
}
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {
revert(0, 0)
}
function shift_right_224_unsigned(value) -> newValue {
newValue :=
shr(224, value)
}
function validator_revert_t_uint256(value) {
if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }
}
function zero_value_for_split_t_int256() -> ret {
ret := 0
}
function zero_value_for_split_t_uint256() -> ret {
ret := 0
}
/// @src 0:82:370 "contract C {..."
}
@@ -4,7 +4,20 @@
"function_debug_info_via_yul/input.sol:C":
{
"function-debug": {},
"function-debug-runtime": {}
"function-debug-runtime":
{
"abi_encode_uint256":
{
"parameterSlots": 2,
"returnSlots": 1
},
"calldata_array_index_access_uint256_dyn_calldata":
{
"entryPoint": 168,
"parameterSlots": 2,
"returnSlots": 1
}
}
}
},
"version": "<VERSION REMOVED>"
@@ -6,11 +6,11 @@ Optimized IR:
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"ir_compiler_inheritance_nosubobjects/input.sol", 1:"#utility.yul"
/// @use-src 0:"ir_compiler_inheritance_nosubobjects/input.sol"
object "C_7" {
code {
{
/// @src 0:82:117
/// @src 0:82:117 "contract C {..."
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("C_7_deployed")
@@ -18,10 +18,11 @@ object "C_7" {
return(128, _1)
}
}
/// @use-src 0:"ir_compiler_inheritance_nosubobjects/input.sol"
object "C_7_deployed" {
code {
{
/// @src 0:82:117
/// @src 0:82:117 "contract C {..."
mstore(64, 128)
revert(0, 0)
}
@@ -38,11 +39,11 @@ Optimized IR:
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"ir_compiler_inheritance_nosubobjects/input.sol", 1:"#utility.yul"
/// @use-src 0:"ir_compiler_inheritance_nosubobjects/input.sol"
object "D_10" {
code {
{
/// @src 0:118:137
/// @src 0:118:137 "contract D is C {..."
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("D_10_deployed")
@@ -50,10 +51,11 @@ object "D_10" {
return(128, _1)
}
}
/// @use-src 0:"ir_compiler_inheritance_nosubobjects/input.sol"
object "D_10_deployed" {
code {
{
/// @src 0:118:137
/// @src 0:118:137 "contract D is C {..."
mstore(64, 128)
revert(0, 0)
}
+21 -17
View File
@@ -6,11 +6,11 @@ Optimized IR:
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"ir_compiler_subobjects/input.sol", 1:"#utility.yul"
/// @use-src 0:"ir_compiler_subobjects/input.sol"
object "C_3" {
code {
{
/// @src 0:82:95
/// @src 0:82:95 "contract C {}"
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("C_3_deployed")
@@ -18,10 +18,11 @@ object "C_3" {
return(128, _1)
}
}
/// @use-src 0:"ir_compiler_subobjects/input.sol"
object "C_3_deployed" {
code {
{
/// @src 0:82:95
/// @src 0:82:95 "contract C {}"
mstore(64, 128)
revert(0, 0)
}
@@ -38,11 +39,11 @@ Optimized IR:
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"ir_compiler_subobjects/input.sol", 1:"#utility.yul"
/// @use-src 0:"ir_compiler_subobjects/input.sol"
object "D_16" {
code {
{
/// @src 0:96:165
/// @src 0:96:165 "contract D {..."
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("D_16_deployed")
@@ -50,10 +51,11 @@ object "D_16" {
return(128, _1)
}
}
/// @use-src 0:"ir_compiler_subobjects/input.sol"
object "D_16_deployed" {
code {
{
/// @src 0:96:165
/// @src 0:96:165 "contract D {..."
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
@@ -62,22 +64,22 @@ object "D_16" {
{
if callvalue() { revert(_1, _1) }
if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) }
/// @src 0:149:156
/// @src 0:149:156 "new C()"
let _2 := datasize("C_3")
let _3 := add(/** @src 0:96:165 */ 128, /** @src 0:149:156 */ _2)
if or(gt(_3, 0xffffffffffffffff), lt(_3, /** @src 0:96:165 */ 128))
/// @src 0:149:156
let _3 := add(/** @src 0:96:165 "contract D {..." */ 128, /** @src 0:149:156 "new C()" */ _2)
if or(gt(_3, 0xffffffffffffffff), lt(_3, /** @src 0:96:165 "contract D {..." */ 128))
/// @src 0:149:156 "new C()"
{
/// @src 0:96:165
/// @src 0:96:165 "contract D {..."
mstore(_1, shl(224, 0x4e487b71))
mstore(4, 0x41)
revert(_1, 0x24)
}
/// @src 0:149:156
datacopy(/** @src 0:96:165 */ 128, /** @src 0:149:156 */ dataoffset("C_3"), _2)
if iszero(create(/** @src 0:96:165 */ _1, 128, /** @src 0:149:156 */ _2))
/// @src 0:149:156 "new C()"
datacopy(/** @src 0:96:165 "contract D {..." */ 128, /** @src 0:149:156 "new C()" */ dataoffset("C_3"), _2)
if iszero(create(/** @src 0:96:165 "contract D {..." */ _1, 128, /** @src 0:149:156 "new C()" */ _2))
{
/// @src 0:96:165
/// @src 0:96:165 "contract D {..."
let pos := mload(64)
returndatacopy(pos, _1, returndatasize())
revert(pos, returndatasize())
@@ -88,10 +90,11 @@ object "D_16" {
revert(0, 0)
}
}
/// @use-src 0:"ir_compiler_subobjects/input.sol"
object "C_3" {
code {
{
/// @src 0:82:95
/// @src 0:82:95 "contract C {}"
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("C_3_deployed")
@@ -99,10 +102,11 @@ object "D_16" {
return(128, _1)
}
}
/// @use-src 0:"ir_compiler_subobjects/input.sol"
object "C_3_deployed" {
code {
{
/// @src 0:82:95
/// @src 0:82:95 "contract C {}"
mstore(64, 128)
revert(0, 0)
}
@@ -6,11 +6,11 @@ Optimized IR:
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"ir_with_assembly_no_memoryguard_creation/input.sol", 1:"#utility.yul"
/// @use-src 0:"ir_with_assembly_no_memoryguard_creation/input.sol"
object "D_12" {
code {
{
/// @src 0:82:161
/// @src 0:82:161 "contract D {..."
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("D_12_deployed")
@@ -18,10 +18,11 @@ object "D_12" {
return(128, _1)
}
}
/// @use-src 0:"ir_with_assembly_no_memoryguard_creation/input.sol"
object "D_12_deployed" {
code {
{
/// @src 0:82:161
/// @src 0:82:161 "contract D {..."
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
@@ -6,11 +6,11 @@ Optimized IR:
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"ir_with_assembly_no_memoryguard_runtime/input.sol", 1:"#utility.yul"
/// @use-src 0:"ir_with_assembly_no_memoryguard_runtime/input.sol"
object "D_8" {
code {
{
/// @src 0:82:153
/// @src 0:82:153 "contract D {..."
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("D_8_deployed")
@@ -18,10 +18,11 @@ object "D_8" {
return(128, _1)
}
}
/// @use-src 0:"ir_with_assembly_no_memoryguard_runtime/input.sol"
object "D_8_deployed" {
code {
{
/// @src 0:82:153
/// @src 0:82:153 "contract D {..."
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
@@ -6,32 +6,33 @@ Optimized IR:
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"keccak_optimization_deploy_code/input.sol", 1:"#utility.yul"
/// @use-src 0:"keccak_optimization_deploy_code/input.sol"
object "C_12" {
code {
{
/// @src 0:62:463
/// @src 0:62:463 "contract C {..."
mstore(64, 128)
if callvalue() { revert(0, 0) }
/// @src 0:103:275
/// @src 0:103:275 "assembly {..."
mstore(0, 100)
sstore(0, keccak256(0, 32))
/// @src 0:62:463
/// @src 0:62:463 "contract C {..."
let _1 := datasize("C_12_deployed")
codecopy(128, dataoffset("C_12_deployed"), _1)
return(128, _1)
}
}
/// @use-src 0:"keccak_optimization_deploy_code/input.sol"
object "C_12_deployed" {
code {
{
/// @src 0:62:463
/// @src 0:62:463 "contract C {..."
mstore(64, 128)
if callvalue() { revert(0, 0) }
/// @src 0:317:454
/// @src 0:317:454 "assembly {..."
mstore(0, 100)
sstore(0, 17385872270140913825666367956517731270094621555228275961425792378517567244498)
/// @src 0:62:463
/// @src 0:62:463 "contract C {..."
stop()
}
}
@@ -6,11 +6,11 @@ Optimized IR:
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"keccak_optimization_low_runs/input.sol", 1:"#utility.yul"
/// @use-src 0:"keccak_optimization_low_runs/input.sol"
object "C_7" {
code {
{
/// @src 0:62:285
/// @src 0:62:285 "contract C {..."
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("C_7_deployed")
@@ -18,16 +18,17 @@ object "C_7" {
return(128, _1)
}
}
/// @use-src 0:"keccak_optimization_low_runs/input.sol"
object "C_7_deployed" {
code {
{
/// @src 0:62:285
/// @src 0:62:285 "contract C {..."
mstore(64, 128)
if callvalue() { revert(0, 0) }
/// @src 0:109:277
/// @src 0:109:277 "assembly {..."
mstore(0, 100)
sstore(0, keccak256(0, 32))
/// @src 0:62:285
/// @src 0:62:285 "contract C {..."
stop()
}
}
@@ -0,0 +1 @@
--no-optimize-yul --link --libraries input.sol:L=0x1234567890123456789012345678901234567890
@@ -0,0 +1 @@
Option --no-optimize-yul is only valid in compiler and assembler modes.
@@ -0,0 +1 @@
--optimize --link --libraries input.sol:L=0x1234567890123456789012345678901234567890
@@ -0,0 +1 @@
Option --optimize is only valid in compiler and assembler modes.
@@ -0,0 +1 @@
1
@@ -0,0 +1 @@
--optimize-runs 1000 --link --libraries input.sol:L=0x1234567890123456789012345678901234567890
@@ -0,0 +1 @@
Option --optimize-runs is only valid in compiler and assembler modes.
@@ -0,0 +1 @@
1
@@ -0,0 +1 @@
--optimize-yul --link --libraries input.sol:L=0x1234567890123456789012345678901234567890
@@ -0,0 +1 @@
Option --optimize-yul is only valid in compiler and assembler modes.
@@ -0,0 +1 @@
1
@@ -0,0 +1 @@
--yul-optimizations a --link --libraries input.sol:L=0x1234567890123456789012345678901234567890
@@ -0,0 +1 @@
Option --yul-optimizations is only valid in compiler and assembler modes.
@@ -1,13 +1,13 @@
Warning: CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)
test.f(0x0, 0)
--> model_checker_targets_all_all_engines/input.sol:7:3:
|
7 | --x;
@@ -16,13 +16,13 @@ test.f(0, 0)
Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)
test.f(0x0, 2)
--> model_checker_targets_all_all_engines/input.sol:8:3:
|
8 | x + type(uint).max;
@@ -31,13 +31,13 @@ test.f(0, 2)
Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_all_engines/input.sol:9:3:
|
9 | 2 / x;
@@ -46,13 +46,13 @@ test.f(0, 1)
Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_all_engines/input.sol:11:3:
|
11 | assert(x > 0);
@@ -61,13 +61,13 @@ test.f(0, 1)
Warning: CHC: Empty array "pop" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_all_engines/input.sol:12:3:
|
12 | arr.pop();
@@ -76,13 +76,13 @@ test.f(0, 1)
Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_all_engines/input.sol:13:3:
|
13 | arr[x];
@@ -1,13 +1,13 @@
Warning: CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)
test.f(0x0, 0)
--> model_checker_targets_all_chc/input.sol:7:3:
|
7 | --x;
@@ -16,13 +16,13 @@ test.f(0, 0)
Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)
test.f(0x0, 2)
--> model_checker_targets_all_chc/input.sol:8:3:
|
8 | x + type(uint).max;
@@ -31,13 +31,13 @@ test.f(0, 2)
Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_chc/input.sol:9:3:
|
9 | 2 / x;
@@ -46,13 +46,13 @@ test.f(0, 1)
Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_chc/input.sol:11:3:
|
11 | assert(x > 0);
@@ -61,13 +61,13 @@ test.f(0, 1)
Warning: CHC: Empty array "pop" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_chc/input.sol:12:3:
|
12 | arr.pop();
@@ -76,13 +76,13 @@ test.f(0, 1)
Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_chc/input.sol:13:3:
|
13 | arr[x];
@@ -1,13 +1,13 @@
Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_assert_chc/input.sol:11:3:
|
11 | assert(x > 0);
@@ -1,13 +1,13 @@
Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_all_engines/input.sol:9:3:
|
9 | 2 / x;
@@ -16,13 +16,13 @@ test.f(0, 1)
Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_all_engines/input.sol:11:3:
|
11 | assert(x > 0);
@@ -31,13 +31,13 @@ test.f(0, 1)
Warning: CHC: Empty array "pop" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_all_engines/input.sol:12:3:
|
12 | arr.pop();
@@ -46,13 +46,13 @@ test.f(0, 1)
Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_all_engines/input.sol:13:3:
|
13 | arr[x];
@@ -1,13 +1,13 @@
Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_chc/input.sol:9:3:
|
9 | 2 / x;
@@ -16,13 +16,13 @@ test.f(0, 1)
Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_chc/input.sol:11:3:
|
11 | assert(x > 0);
@@ -31,13 +31,13 @@ test.f(0, 1)
Warning: CHC: Empty array "pop" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_chc/input.sol:12:3:
|
12 | arr.pop();
@@ -46,13 +46,13 @@ test.f(0, 1)
Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_chc/input.sol:13:3:
|
13 | arr[x];
@@ -1,13 +1,13 @@
Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_div_by_zero_chc/input.sol:9:3:
|
9 | 2 / x;
@@ -1,13 +1,13 @@
Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_out_of_bounds_chc/input.sol:13:3:
|
13 | arr[x];
@@ -1,13 +1,13 @@
Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)
test.f(0x0, 2)
--> model_checker_targets_overflow_chc/input.sol:8:3:
|
8 | x + type(uint).max;
@@ -1,13 +1,13 @@
Warning: CHC: Empty array "pop" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_pop_empty_chc/input.sol:12:3:
|
12 | arr.pop();
@@ -1,13 +1,13 @@
Warning: CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)
test.f(0x0, 0)
--> model_checker_targets_underflow_chc/input.sol:7:3:
|
7 | --x;
@@ -1,13 +1,13 @@
Warning: CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)
test.f(0x0, 0)
--> model_checker_targets_underflow_overflow_assert_chc/input.sol:7:3:
|
7 | --x;
@@ -16,13 +16,13 @@ test.f(0, 0)
Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)
test.f(0x0, 2)
--> model_checker_targets_underflow_overflow_assert_chc/input.sol:8:3:
|
8 | x + type(uint).max;
@@ -31,13 +31,13 @@ test.f(0, 2)
Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_underflow_overflow_assert_chc/input.sol:11:3:
|
11 | assert(x > 0);
@@ -1,13 +1,13 @@
Warning: CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)
test.f(0x0, 0)
--> model_checker_targets_underflow_overflow_chc/input.sol:7:3:
|
7 | --x;
@@ -16,13 +16,13 @@ test.f(0, 0)
Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)
test.f(0x0, 2)
--> model_checker_targets_underflow_overflow_chc/input.sol:8:3:
|
8 | x + type(uint).max;
+39 -40
View File
@@ -6,11 +6,11 @@ Optimized IR:
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"name_simplifier/input.sol", 1:"#utility.yul"
/// @use-src 0:"name_simplifier/input.sol"
object "C_59" {
code {
{
/// @src 0:346:625
/// @src 0:346:625 "contract C {..."
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("C_59_deployed")
@@ -18,10 +18,11 @@ object "C_59" {
return(128, _1)
}
}
/// @use-src 0:"name_simplifier/input.sol"
object "C_59_deployed" {
code {
{
/// @src 0:346:625
/// @src 0:346:625 "contract C {..."
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
@@ -42,17 +43,16 @@ object "C_59" {
let dst_1 := dst
mstore(dst, _4)
dst := add(dst, _2)
let srcEnd := add(add(offset, _5), 36)
if gt(srcEnd, calldatasize()) { revert(_1, _1) }
let src := add(offset, 36)
if gt(add(add(offset, _5), 36), calldatasize()) { revert(_1, _1) }
let i := _1
for { } lt(i, _4) { i := add(i, 1) }
for { } lt(src, srcEnd) { src := add(src, _2) }
{
if slt(sub(calldatasize(), src), _2) { revert(_1, _1) }
let value := allocate_memory_1236()
let value := allocate_memory_1174()
mstore(value, calldataload(src))
mstore(dst, value)
dst := add(dst, _2)
src := add(src, _2)
}
let ret, ret_1 := fun_sumArray(dst_1)
let memPos := mload(64)
@@ -61,6 +61,26 @@ object "C_59" {
}
revert(0, 0)
}
function panic_error_0x41()
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x41)
revert(0, 0x24)
}
function allocate_memory_1174() -> memPtr
{
memPtr := mload(64)
let newFreePtr := add(memPtr, 32)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
function allocate_memory(size) -> memPtr
{
memPtr := mload(64)
let newFreePtr := add(memPtr, and(add(size, 31), not(31)))
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
function abi_encode_uint256_string(headStart, value0, value1) -> tail
{
mstore(headStart, value0)
@@ -79,32 +99,24 @@ object "C_59" {
}
tail := add(add(headStart, and(add(length, 31), not(31))), 96)
}
function allocate_memory_1236() -> memPtr
function panic_error_0x32()
{
memPtr := mload(64)
let newFreePtr := add(memPtr, 32)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x32)
revert(0, 0x24)
}
function allocate_memory(size) -> memPtr
{
memPtr := mload(64)
let newFreePtr := add(memPtr, and(add(size, 31), not(31)))
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
/// @src 0:381:623
/// @ast-id 58 @src 0:381:623 "function sumArray(S[] memory _s) public returns (uint, string memory) {..."
function fun_sumArray(var_s_mpos) -> var, var_mpos
{
/// @src 0:346:625
/// @src 0:346:625 "contract C {..."
if iszero(mload(var_s_mpos)) { panic_error_0x32() }
sstore(/** @src 0:472:473 */ 0x00, /** @src 0:346:625 */ mload(/** @src 0:469:474 */ mload(/** @src 0:346:625 */ add(var_s_mpos, 32))))
sstore(/** @src 0:472:473 "0" */ 0x00, /** @src 0:346:625 "contract C {..." */ mload(/** @src 0:469:474 "_s[0]" */ mload(/** @src 0:346:625 "contract C {..." */ add(var_s_mpos, 32))))
if iszero(lt(1, mload(var_s_mpos))) { panic_error_0x32() }
let _1 := mload(/** @src 0:489:494 */ mload(/** @src 0:346:625 */ add(var_s_mpos, 64)))
let _1 := mload(/** @src 0:489:494 "_s[1]" */ mload(/** @src 0:346:625 "contract C {..." */ add(var_s_mpos, 64)))
sstore(0x02, _1)
/// @src 0:500:619
/// @src 0:500:619 "return (t.y[0], \"longstringlongstringlongstringlongstringlongstringlongstringlongstringlongstringlongstringlongstring\")"
var := _1
/// @src 0:346:625
/// @src 0:346:625 "contract C {..."
let memPtr := mload(64)
let newFreePtr := add(memPtr, 160)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
@@ -114,22 +126,9 @@ object "C_59" {
mstore(add(memPtr, 64), "ngstringlongstringlongstringlong")
mstore(add(memPtr, 96), "stringlongstringlongstringlongst")
mstore(add(memPtr, 128), "ring")
/// @src 0:500:619
/// @src 0:500:619 "return (t.y[0], \"longstringlongstringlongstringlongstringlongstringlongstringlongstringlongstringlongstringlongstring\")"
var_mpos := memPtr
}
/// @src 0:346:625
function panic_error_0x32()
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x32)
revert(0, 0x24)
}
function panic_error_0x41()
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x41)
revert(0, 0x24)
}
}
data ".metadata" hex"<BYTECODE REMOVED>"
}
+16 -15
View File
@@ -6,11 +6,11 @@ Optimized IR:
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"optimizer_array_sload/input.sol", 1:"#utility.yul"
/// @use-src 0:"optimizer_array_sload/input.sol"
object "Arraysum_34" {
code {
{
/// @src 0:80:429
/// @src 0:80:429 "contract Arraysum {..."
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("Arraysum_34_deployed")
@@ -18,10 +18,11 @@ object "Arraysum_34" {
return(128, _1)
}
}
/// @use-src 0:"optimizer_array_sload/input.sol"
object "Arraysum_34_deployed" {
code {
{
/// @src 0:80:429
/// @src 0:80:429 "contract Arraysum {..."
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
@@ -31,27 +32,27 @@ object "Arraysum_34" {
if callvalue() { revert(_1, _1) }
if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) }
let var_sum := _1
/// @src 0:368:378
let var_i := /** @src 0:80:429 */ _1
/// @src 0:368:378 "uint i = 0"
let var_i := /** @src 0:80:429 "contract Arraysum {..." */ _1
let _2 := sload(_1)
/// @src 0:364:423
/// @src 0:364:423 "for(uint i = 0; i < values.length; i++)..."
for { }
/** @src 0:380:397 */ lt(var_i, _2)
/// @src 0:368:378
/** @src 0:380:397 "i < values.length" */ lt(var_i, _2)
/// @src 0:368:378 "uint i = 0"
{
/// @src 0:80:429
/// @src 0:80:429 "contract Arraysum {..."
if eq(var_i, not(0)) { panic_error_0x11() }
/// @src 0:399:402
var_i := /** @src 0:80:429 */ add(var_i, 1)
/// @src 0:399:402 "i++"
var_i := /** @src 0:80:429 "contract Arraysum {..." */ add(var_i, 1)
}
/// @src 0:399:402
/// @src 0:399:402 "i++"
{
/// @src 0:80:429
/// @src 0:80:429 "contract Arraysum {..."
mstore(_1, _1)
let _3 := sload(add(18569430475105882587588266137607568536673111973893317399460219858819262702947, var_i))
if gt(var_sum, not(_3)) { panic_error_0x11() }
/// @src 0:407:423
var_sum := /** @src 0:80:429 */ add(var_sum, _3)
/// @src 0:407:423 "sum += values[i]"
var_sum := /** @src 0:80:429 "contract Arraysum {..." */ add(var_sum, _3)
}
let memPos := mload(64)
return(memPos, sub(abi_encode_uint256(memPos, var_sum), memPos))
@@ -31,6 +31,7 @@ JSON AST (compact format):
{
"abstract": false,
"baseContracts": [],
"canonicalName": "Error1",
"contractDependencies": [],
"contractKind": "contract",
"fullyImplemented": true,
@@ -10,4 +10,4 @@
2 | pragma solidity >=0.0; contract Errort6 { using foo for ; /* missing type name */ }
| ^
","message":"Recovered in ContractDefinition at '}'.","severity":"warning","sourceLocation":{"end":120,"file":"A","start":119},"type":"Warning"}],"sources":{"A":{"ast":{"absolutePath":"A","exportedSymbols":{"Errort6":[3]},"id":4,"license":"GPL-3.0","nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.0"],"nodeType":"PragmaDirective","src":"36:22:0"},{"abstract":false,"baseContracts":[],"contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"id":3,"linearizedBaseContracts":[3],"name":"Errort6","nameLocation":"68:7:0","nodeType":"ContractDefinition","nodes":[],"scope":4,"src":"59:35:0","usedErrors":[]}],"src":"36:84:0"},"id":0}}}
","message":"Recovered in ContractDefinition at '}'.","severity":"warning","sourceLocation":{"end":120,"file":"A","start":119},"type":"Warning"}],"sources":{"A":{"ast":{"absolutePath":"A","exportedSymbols":{"Errort6":[3]},"id":4,"license":"GPL-3.0","nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.0"],"nodeType":"PragmaDirective","src":"36:22:0"},{"abstract":false,"baseContracts":[],"canonicalName":"Errort6","contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"id":3,"linearizedBaseContracts":[3],"name":"Errort6","nameLocation":"68:7:0","nodeType":"ContractDefinition","nodes":[],"scope":4,"src":"59:35:0","usedErrors":[]}],"src":"36:84:0"},"id":0}}}
+235 -235
View File
@@ -7,10 +7,10 @@ IR:
*=====================================================*/
/// @use-src 0:"revert_strings/input.sol", 1:"#utility.yul"
/// @use-src 0:"revert_strings/input.sol"
object "C_15" {
code {
/// @src 0:59:147
/// @src 0:59:147 "contract C {..."
mstore(64, 128)
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
@@ -25,14 +25,6 @@ object "C_15" {
memPtr := mload(64)
}
/// @src 0:59:147
function constructor_C_15() {
/// @src 0:59:147
}
/// @src 0:59:147
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
let start := allocate_unbounded()
@@ -52,10 +44,19 @@ object "C_15" {
}
/// @src 0:59:147 "contract C {..."
function constructor_C_15() {
/// @src 0:59:147 "contract C {..."
}
/// @src 0:59:147 "contract C {..."
}
/// @use-src 0:"revert_strings/input.sol"
object "C_15_deployed" {
code {
/// @src 0:59:147
/// @src 0:59:147 "contract C {..."
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
@@ -80,233 +81,17 @@ object "C_15" {
if iszero(calldatasize()) { }
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
// uint256[][]
function abi_decode_available_length_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(offset, length, end) -> array {
array := allocate_memory(array_allocation_size_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(length))
let dst := array
function shift_right_224_unsigned(value) -> newValue {
newValue :=
mstore(array, length)
dst := add(array, 0x20)
shr(224, value)
let src := offset
if gt(add(src, mul(length, 0x20)), end) {
revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef()
}
for { let i := 0 } lt(i, length) { i := add(i, 1) }
{
let innerOffset := calldataload(src)
if gt(innerOffset, 0xffffffffffffffff) { revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() }
let elementPos := add(offset, innerOffset)
mstore(dst, abi_decode_t_array$_t_uint256_$dyn_memory_ptr(elementPos, end))
dst := add(dst, 0x20)
src := add(src, 0x20)
}
}
// uint256[]
function abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr(offset, length, end) -> array {
array := allocate_memory(array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr(length))
let dst := array
mstore(array, length)
dst := add(array, 0x20)
let src := offset
if gt(add(src, mul(length, 0x20)), end) {
revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef()
}
for { let i := 0 } lt(i, length) { i := add(i, 1) }
{
let elementPos := src
mstore(dst, abi_decode_t_uint256(elementPos, end))
dst := add(dst, 0x20)
src := add(src, 0x20)
}
}
// uint256[][]
function abi_decode_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(offset, end) -> array {
if iszero(slt(add(offset, 0x1f), end)) { revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() }
let length := calldataload(offset)
array := abi_decode_available_length_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(add(offset, 0x20), length, end)
}
// uint256[]
function abi_decode_t_array$_t_uint256_$dyn_memory_ptr(offset, end) -> array {
if iszero(slt(add(offset, 0x1f), end)) { revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() }
let length := calldataload(offset)
array := abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr(add(offset, 0x20), length, end)
}
function abi_decode_t_enum$_E_$3(offset, end) -> value {
value := calldataload(offset)
validator_revert_t_enum$_E_$3(value)
}
function abi_decode_t_uint256(offset, end) -> value {
value := calldataload(offset)
validator_revert_t_uint256(value)
}
function abi_decode_tuple_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptrt_enum$_E_$3(headStart, dataEnd) -> value0, value1 {
if slt(sub(dataEnd, headStart), 64) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
{
let offset := calldataload(add(headStart, 0))
if gt(offset, 0xffffffffffffffff) { revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() }
value0 := abi_decode_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(add(headStart, offset), dataEnd)
}
{
let offset := 32
value1 := abi_decode_t_enum$_E_$3(add(headStart, offset), dataEnd)
}
}
function abi_encode_tuple__to__fromStack(headStart ) -> tail {
tail := add(headStart, 0)
}
function allocate_memory(size) -> memPtr {
memPtr := allocate_unbounded()
finalize_allocation(memPtr, size)
}
function allocate_unbounded() -> memPtr {
memPtr := mload(64)
}
function array_allocation_size_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(length) -> size {
// Make sure we can allocate memory without overflow
if gt(length, 0xffffffffffffffff) { panic_error_0x41() }
size := mul(length, 0x20)
// add length slot
size := add(size, 0x20)
}
function array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr(length) -> size {
// Make sure we can allocate memory without overflow
if gt(length, 0xffffffffffffffff) { panic_error_0x41() }
size := mul(length, 0x20)
// add length slot
size := add(size, 0x20)
}
function cleanup_t_uint256(value) -> cleaned {
cleaned := value
}
function finalize_allocation(memPtr, size) {
let newFreePtr := add(memPtr, round_up_to_mul_of_32(size))
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
/// @src 0:93:145
function fun_f_14(var__7_mpos, var_e_10) {
}
/// @src 0:59:147
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() {
let start := allocate_unbounded()
let pos := start
mstore(pos, 3963877391197344453575983046348115674221700746820753546331534351508065746944)
pos := add(pos, 4)
mstore(pos, 0x20)
pos := add(pos, 0x20)
mstore(pos, 43)
pos := add(pos, 0x20)
mstore(add(pos, 0), "ABI decoding: invalid calldata a")
mstore(add(pos, 32), "rray offset")
revert(start, 132)
}
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
let start := allocate_unbounded()
let pos := start
mstore(pos, 3963877391197344453575983046348115674221700746820753546331534351508065746944)
pos := add(pos, 4)
mstore(pos, 0x20)
pos := add(pos, 0x20)
mstore(pos, 53)
pos := add(pos, 0x20)
mstore(add(pos, 0), "Contract does not have fallback ")
mstore(add(pos, 32), "nor receive functions")
revert(start, 132)
}
function revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef() {
let start := allocate_unbounded()
let pos := start
mstore(pos, 3963877391197344453575983046348115674221700746820753546331534351508065746944)
pos := add(pos, 4)
mstore(pos, 0x20)
pos := add(pos, 0x20)
mstore(pos, 43)
pos := add(pos, 0x20)
mstore(add(pos, 0), "ABI decoding: invalid calldata a")
mstore(add(pos, 32), "rray stride")
revert(start, 132)
}
function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {
let start := allocate_unbounded()
let pos := start
mstore(pos, 3963877391197344453575983046348115674221700746820753546331534351508065746944)
pos := add(pos, 4)
mstore(pos, 0x20)
pos := add(pos, 0x20)
mstore(pos, 34)
pos := add(pos, 0x20)
mstore(add(pos, 0), "ABI decoding: invalid tuple offs")
mstore(add(pos, 32), "et")
revert(start, 132)
}
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
let start := allocate_unbounded()
@@ -345,25 +130,240 @@ object "C_15" {
}
function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {
let start := allocate_unbounded()
let pos := start
mstore(pos, 3963877391197344453575983046348115674221700746820753546331534351508065746944)
pos := add(pos, 4)
mstore(pos, 0x20)
pos := add(pos, 0x20)
mstore(pos, 34)
pos := add(pos, 0x20)
mstore(add(pos, 0), "ABI decoding: invalid tuple offs")
mstore(add(pos, 32), "et")
revert(start, 132)
}
function revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() {
let start := allocate_unbounded()
let pos := start
mstore(pos, 3963877391197344453575983046348115674221700746820753546331534351508065746944)
pos := add(pos, 4)
mstore(pos, 0x20)
pos := add(pos, 0x20)
mstore(pos, 43)
pos := add(pos, 0x20)
mstore(add(pos, 0), "ABI decoding: invalid calldata a")
mstore(add(pos, 32), "rray offset")
revert(start, 132)
}
function round_up_to_mul_of_32(value) -> result {
result := and(add(value, 31), not(31))
}
function shift_right_224_unsigned(value) -> newValue {
newValue :=
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
shr(224, value)
function finalize_allocation(memPtr, size) {
let newFreePtr := add(memPtr, round_up_to_mul_of_32(size))
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
function allocate_memory(size) -> memPtr {
memPtr := allocate_unbounded()
finalize_allocation(memPtr, size)
}
function array_allocation_size_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(length) -> size {
// Make sure we can allocate memory without overflow
if gt(length, 0xffffffffffffffff) { panic_error_0x41() }
size := mul(length, 0x20)
// add length slot
size := add(size, 0x20)
}
function revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef() {
let start := allocate_unbounded()
let pos := start
mstore(pos, 3963877391197344453575983046348115674221700746820753546331534351508065746944)
pos := add(pos, 4)
mstore(pos, 0x20)
pos := add(pos, 0x20)
mstore(pos, 43)
pos := add(pos, 0x20)
mstore(add(pos, 0), "ABI decoding: invalid calldata a")
mstore(add(pos, 32), "rray stride")
revert(start, 132)
}
function array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr(length) -> size {
// Make sure we can allocate memory without overflow
if gt(length, 0xffffffffffffffff) { panic_error_0x41() }
size := mul(length, 0x20)
// add length slot
size := add(size, 0x20)
}
function cleanup_t_uint256(value) -> cleaned {
cleaned := value
}
function validator_revert_t_uint256(value) {
if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }
}
function abi_decode_t_uint256(offset, end) -> value {
value := calldataload(offset)
validator_revert_t_uint256(value)
}
// uint256[]
function abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr(offset, length, end) -> array {
array := allocate_memory(array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr(length))
let dst := array
mstore(array, length)
dst := add(array, 0x20)
let srcEnd := add(offset, mul(length, 0x20))
if gt(srcEnd, end) {
revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef()
}
for { let src := offset } lt(src, srcEnd) { src := add(src, 0x20) }
{
let elementPos := src
mstore(dst, abi_decode_t_uint256(elementPos, end))
dst := add(dst, 0x20)
}
}
// uint256[]
function abi_decode_t_array$_t_uint256_$dyn_memory_ptr(offset, end) -> array {
if iszero(slt(add(offset, 0x1f), end)) { revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() }
let length := calldataload(offset)
array := abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr(add(offset, 0x20), length, end)
}
// uint256[][]
function abi_decode_available_length_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(offset, length, end) -> array {
array := allocate_memory(array_allocation_size_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(length))
let dst := array
mstore(array, length)
dst := add(array, 0x20)
let srcEnd := add(offset, mul(length, 0x20))
if gt(srcEnd, end) {
revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef()
}
for { let src := offset } lt(src, srcEnd) { src := add(src, 0x20) }
{
let innerOffset := calldataload(src)
if gt(innerOffset, 0xffffffffffffffff) { revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() }
let elementPos := add(offset, innerOffset)
mstore(dst, abi_decode_t_array$_t_uint256_$dyn_memory_ptr(elementPos, end))
dst := add(dst, 0x20)
}
}
// uint256[][]
function abi_decode_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(offset, end) -> array {
if iszero(slt(add(offset, 0x1f), end)) { revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() }
let length := calldataload(offset)
array := abi_decode_available_length_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(add(offset, 0x20), length, end)
}
function validator_revert_t_enum$_E_$3(value) {
if iszero(lt(value, 1)) { revert(0, 0) }
}
function validator_revert_t_uint256(value) {
if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }
function abi_decode_t_enum$_E_$3(offset, end) -> value {
value := calldataload(offset)
validator_revert_t_enum$_E_$3(value)
}
function abi_decode_tuple_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptrt_enum$_E_$3(headStart, dataEnd) -> value0, value1 {
if slt(sub(dataEnd, headStart), 64) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
{
let offset := calldataload(add(headStart, 0))
if gt(offset, 0xffffffffffffffff) { revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() }
value0 := abi_decode_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(add(headStart, offset), dataEnd)
}
{
let offset := 32
value1 := abi_decode_t_enum$_E_$3(add(headStart, offset), dataEnd)
}
}
function abi_encode_tuple__to__fromStack(headStart ) -> tail {
tail := add(headStart, 0)
}
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
let start := allocate_unbounded()
let pos := start
mstore(pos, 3963877391197344453575983046348115674221700746820753546331534351508065746944)
pos := add(pos, 4)
mstore(pos, 0x20)
pos := add(pos, 0x20)
mstore(pos, 53)
pos := add(pos, 0x20)
mstore(add(pos, 0), "Contract does not have fallback ")
mstore(add(pos, 32), "nor receive functions")
revert(start, 132)
}
/// @ast-id 14
/// @src 0:93:145 "function f(uint[][] memory, E e) public pure {..."
function fun_f_14(var__7_mpos, var_e_10) {
}
/// @src 0:59:147 "contract C {..."
}
data ".metadata" hex"<BYTECODE REMOVED>"
@@ -1,10 +1,10 @@
{"contracts":{"C":{"C":{"evm":{"assembly":" /* \"C\":79:428 contract C... */
mstore(0x40, 0xa0)
jumpi(tag_1, iszero(callvalue))
jumpi(tag_2, iszero(callvalue))
0x00
dup1
revert
tag_1:
tag_2:
bytecodeSize
codesize
dup2
@@ -27,12 +27,12 @@ tag_1:
lt
or
iszero
tag_2
tag_3
jumpi
mstore(0x00, shl(0xe0, 0x4e487b71))
mstore(0x04, 0x41)
revert(0x00, 0x24)
tag_2:
tag_3:
0x40
mstore
dup1
@@ -43,25 +43,26 @@ tag_2:
dup2
slt
iszero
tag_3
tag_4
jumpi
0x00
dup1
revert
tag_3:
tag_4:
pop
pop
tag_4
tag_5
mload(0xa0)
/* \"C\":147:149 42 */
mstore(0x80, 0x2a)
/* \"C\":203:219 stateVar = _init */
0x00
/* \"C\":79:428 contract C... */
sstore
/* \"C\":175:223 constructor(int _init)... */
jump
/* \"C\":79:428 contract C... */
tag_4:
tag_5:
mload(0x40)
dataSize(sub_0)
dup1
@@ -79,7 +80,7 @@ stop
sub_0: assembly {
/* \"C\":79:428 contract C... */
mstore(0x40, 0x80)
jumpi(tag_1, lt(calldatasize, 0x04))
jumpi(tag_8, lt(calldatasize, 0x04))
0x00
dup1
calldataload
@@ -88,38 +89,38 @@ sub_0: assembly {
0x26121ff0
dup2
eq
tag_3
tag_10
jumpi
0x793816ec
dup2
eq
tag_4
tag_11
jumpi
0x9942ec6f
dup2
eq
tag_5
tag_12
jumpi
jump(tag_2)
tag_3:
jumpi(tag_6, iszero(callvalue))
jump(tag_9)
tag_10:
jumpi(tag_13, iszero(callvalue))
dup2
dup3
revert
tag_6:
tag_7
tag_13:
tag_14
calldatasize
tag_8
tag_1
jump\t// in
tag_7:
tag_14:
/* \"C\":279:298 constVar + immutVar */
tag_9
tag_15
/* \"C\":290:298 immutVar */
immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\")
/* \"C\":279:298 constVar + immutVar */
tag_10
tag_4
jump\t// in
tag_9:
tag_15:
/* \"C\":79:428 contract C... */
mload(0x40)
dup2
@@ -128,17 +129,17 @@ sub_0: assembly {
0x20
dup2
return
tag_4:
jumpi(tag_13, iszero(callvalue))
tag_11:
jumpi(tag_17, iszero(callvalue))
dup2
dup3
revert
tag_13:
tag_14
tag_17:
tag_18
calldatasize
tag_8
tag_1
jump\t// in
tag_14:
tag_18:
dup2
sload
mload(0x40)
@@ -148,65 +149,50 @@ sub_0: assembly {
0x20
dup2
return
tag_5:
jumpi(tag_16, iszero(callvalue))
tag_12:
jumpi(tag_20, iszero(callvalue))
dup2
dup3
revert
tag_16:
tag_17
tag_20:
tag_21
calldatasize
tag_8
tag_1
jump\t// in
tag_17:
tag_21:
/* \"C\":375:378 int */
tag_9
tag_19
tag_15
tag_6
jump\t// in
/* \"C\":79:428 contract C... */
tag_2:
tag_9:
pop
pop
tag_1:
tag_8:
0x00
dup1
revert
tag_8:
tag_1:
0x00
not(0x03)
dup3
add
slt
iszero
tag_23
jumpi
0x00
dup1
revert
tag_23:
pop
jump\t// out
tag_24:
0x00
0x20
dup3
dup5
sub
slt
iszero
tag_26
jumpi
0x00
dup1
revert
tag_26:
pop
mload
swap2
swap1
pop
jump\t// out
tag_10:
/* \"C\":117:119 41 */
tag_3:
mstore(0x00, shl(0xe0, 0x4e487b71))
mstore(0x04, 0x11)
revert(0x00, 0x24)
tag_4:
0x00
sub(shl(0xff, 0x01), 0x2a)
dup3
@@ -214,20 +200,18 @@ sub_0: assembly {
0x01
and
iszero
tag_30
jumpi
tag_30
tag_31
jumpi
tag_31
tag_3
jump\t// in
tag_30:
tag_31:
pop
/* \"C\":117:119 41 */
0x29
/* \"C\":79:428 contract C... */
add
swap1
jump\t// out
tag_32:
tag_5:
0x00
dup1
dup3
@@ -242,12 +226,12 @@ sub_0: assembly {
sgt
and
iszero
tag_35
tag_34
jumpi
tag_35
tag_31
tag_34
tag_3
jump\t// in
tag_35:
tag_34:
shl(0xff, 0x01)
dup4
swap1
@@ -257,19 +241,19 @@ sub_0: assembly {
dup2
and
iszero
tag_37
tag_36
jumpi
tag_37
tag_31
tag_36
tag_3
jump\t// in
tag_37:
tag_36:
pop
pop
add
swap1
jump\t// out
/* \"C\":304:341 modifier m()... */
tag_19:
tag_6:
0x00
/* \"C\":79:428 contract C... */
dup1
@@ -282,13 +266,15 @@ sub_0: assembly {
dup2
eq
iszero
tag_40
tag_39
jumpi
tag_40
tag_31
tag_39
tag_3
jump\t// in
tag_40:
tag_39:
/* \"C\":117:119 41 */
0x01
/* \"C\":79:428 contract C... */
add
dup1
dup3
@@ -297,14 +283,14 @@ sub_0: assembly {
address
/* \"C\":403:411 this.f() */
extcodesize
tag_41
tag_40
jumpi
/* \"C\":79:428 contract C... */
dup2
dup3
revert
/* \"C\":403:411 this.f() */
tag_41:
tag_40:
/* \"C\":79:428 contract C... */
mload(0x40)
shl(0xe4, 0x026121ff)
@@ -324,7 +310,7 @@ sub_0: assembly {
gas
staticcall
dup1
tag_42
tag_41
jumpi
/* \"C\":79:428 contract C... */
mload(0x40)
@@ -336,13 +322,13 @@ sub_0: assembly {
dup2
revert
/* \"C\":403:411 this.f() */
tag_42:
tag_41:
/* \"C\":79:428 contract C... */
dup4
/* \"C\":403:411 this.f() */
dup2
iszero
tag_43
tag_42
jumpi
returndatasize
/* \"C\":79:428 contract C... */
@@ -350,7 +336,6 @@ sub_0: assembly {
add
not(0x1f)
and
/* \"C\":117:119 41 */
dup4
add
0xffffffffffffffff
@@ -361,10 +346,9 @@ sub_0: assembly {
lt
or
iszero
tag_44
tag_43
jumpi
shl(0xe0, 0x4e487b71)
/* \"C\":79:428 contract C... */
dup7
mstore
0x41
@@ -375,31 +359,28 @@ sub_0: assembly {
0x24
dup7
revert
/* \"C\":117:119 41 */
tag_44:
/* \"C\":79:428 contract C... */
tag_43:
0x40
/* \"C\":117:119 41 */
mstore
/* \"C\":403:411 this.f() */
tag_45
tag_44
returndatasize
dup5
add
dup5
tag_24
tag_7
jump\t// in
tag_45:
tag_44:
swap1
pop
tag_43:
tag_42:
/* \"C\":392:411 stateVar + this.f() */
tag_46
tag_45
dup2
dup6
tag_32
tag_5
jump\t// in
tag_46:
tag_45:
swap5
pop
pop
@@ -407,14 +388,14 @@ sub_0: assembly {
pop
pop
/* \"C\":392:422 stateVar + this.f() + immutVar */
tag_47
tag_46
/* \"C\":414:422 immutVar */
immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\")
/* \"C\":392:422 stateVar + this.f() + immutVar */
dup3
tag_32
tag_5
jump\t// in
tag_47:
tag_46:
/* \"C\":336:337 _ */
swap2
pop
@@ -423,20 +404,36 @@ sub_0: assembly {
swap1
jump\t// out
/* \"C\":79:428 contract C... */
tag_31:
mstore(0x00, shl(0xe0, 0x4e487b71))
mstore(0x04, 0x11)
revert(0x00, 0x24)
tag_7:
0x00
0x20
dup3
dup5
sub
slt
iszero
tag_48
jumpi
0x00
dup1
revert
tag_48:
pop
mload
swap2
swap1
pop
jump\t// out
auxdata: <AUXDATA REMOVED>
}
"}}},"D":{"D":{"evm":{"assembly":" /* \"D\":91:166 contract D is C(3)... */
mstore(0x40, 0xa0)
jumpi(tag_1, iszero(callvalue))
jumpi(tag_2, iszero(callvalue))
0x00
dup1
revert
tag_1:
tag_2:
bytecodeSize
codesize
dup2
@@ -459,12 +456,12 @@ tag_1:
lt
or
iszero
tag_2
tag_3
jumpi
mstore(0x00, shl(0xe0, 0x4e487b71))
mstore(0x04, 0x41)
revert(0x00, 0x24)
tag_2:
tag_3:
0x40
mstore
dup1
@@ -475,19 +472,19 @@ tag_2:
dup2
slt
iszero
tag_3
tag_4
jumpi
0x00
dup1
revert
tag_3:
pop
pop
tag_4
mload(0xa0)
tag_5
jump\t// in
tag_4:
pop
pop
tag_5
mload(0xa0)
tag_1
jump\t// in
tag_5:
mload(0x40)
dataSize(sub_0)
dup1
@@ -501,11 +498,12 @@ tag_4:
dup3
return
/* \"D\":113:164 constructor(int _init2)... */
tag_5:
tag_1:
/* \"C\":147:149 42 */
mstore(0x80, 0x2a)
/* \"D\":107:108 3 */
0x03
/* \"C\":203:219 stateVar = _init */
0x00
/* \"D\":91:166 contract D is C(3)... */
sstore
@@ -517,15 +515,25 @@ tag_5:
iszero
tag_8
jumpi
mstore(0x00, shl(0xe0, 0x4e487b71))
shl(0xe0, 0x4e487b71)
/* \"C\":203:219 stateVar = _init */
0x00
/* \"D\":91:166 contract D is C(3)... */
mstore
mstore(0x04, 0x11)
revert(0x00, 0x24)
0x24
/* \"C\":203:219 stateVar = _init */
0x00
/* \"D\":91:166 contract D is C(3)... */
revert
tag_8:
/* \"D\":107:108 3 */
0x03
/* \"D\":91:166 contract D is C(3)... */
add
/* \"C\":203:219 stateVar = _init */
0x00
/* \"D\":91:166 contract D is C(3)... */
sstore
/* \"D\":113:164 constructor(int _init2)... */
jump\t// out
@@ -534,7 +542,7 @@ stop
sub_0: assembly {
/* \"D\":91:166 contract D is C(3)... */
mstore(0x40, 0x80)
jumpi(tag_1, lt(calldatasize, 0x04))
jumpi(tag_8, lt(calldatasize, 0x04))
0x00
dup1
calldataload
@@ -543,38 +551,38 @@ sub_0: assembly {
0x26121ff0
dup2
eq
tag_3
tag_10
jumpi
0x793816ec
dup2
eq
tag_4
tag_11
jumpi
0x9942ec6f
dup2
eq
tag_5
tag_12
jumpi
jump(tag_2)
tag_3:
jumpi(tag_6, iszero(callvalue))
jump(tag_9)
tag_10:
jumpi(tag_13, iszero(callvalue))
dup2
dup3
revert
tag_6:
tag_7
tag_13:
tag_14
calldatasize
tag_8
tag_1
jump\t// in
tag_7:
tag_14:
/* \"C\":279:298 constVar + immutVar */
tag_9
tag_15
/* \"C\":290:298 immutVar */
immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\")
/* \"C\":279:298 constVar + immutVar */
tag_10
tag_4
jump\t// in
tag_9:
tag_15:
/* \"D\":91:166 contract D is C(3)... */
mload(0x40)
dup2
@@ -583,17 +591,17 @@ sub_0: assembly {
0x20
dup2
return
tag_4:
jumpi(tag_13, iszero(callvalue))
tag_11:
jumpi(tag_17, iszero(callvalue))
dup2
dup3
revert
tag_13:
tag_14
tag_17:
tag_18
calldatasize
tag_8
tag_1
jump\t// in
tag_14:
tag_18:
dup2
sload
mload(0x40)
@@ -603,65 +611,50 @@ sub_0: assembly {
0x20
dup2
return
tag_5:
jumpi(tag_16, iszero(callvalue))
tag_12:
jumpi(tag_20, iszero(callvalue))
dup2
dup3
revert
tag_16:
tag_17
tag_20:
tag_21
calldatasize
tag_8
tag_1
jump\t// in
tag_17:
tag_21:
/* \"C\":375:378 int */
tag_9
tag_19
tag_15
tag_6
jump\t// in
/* \"D\":91:166 contract D is C(3)... */
tag_2:
tag_9:
pop
pop
tag_1:
tag_8:
0x00
dup1
revert
tag_8:
tag_1:
0x00
not(0x03)
dup3
add
slt
iszero
tag_23
jumpi
0x00
dup1
revert
tag_23:
pop
jump\t// out
tag_24:
0x00
0x20
dup3
dup5
sub
slt
iszero
tag_26
jumpi
0x00
dup1
revert
tag_26:
pop
mload
swap2
swap1
pop
jump\t// out
tag_10:
/* \"C\":117:119 41 */
tag_3:
mstore(0x00, shl(0xe0, 0x4e487b71))
mstore(0x04, 0x11)
revert(0x00, 0x24)
tag_4:
0x00
sub(shl(0xff, 0x01), 0x2a)
dup3
@@ -669,20 +662,18 @@ sub_0: assembly {
0x01
and
iszero
tag_30
jumpi
tag_30
tag_31
jumpi
tag_31
tag_3
jump\t// in
tag_30:
tag_31:
pop
/* \"C\":117:119 41 */
0x29
/* \"D\":91:166 contract D is C(3)... */
add
swap1
jump\t// out
tag_32:
tag_5:
0x00
dup1
dup3
@@ -697,12 +688,12 @@ sub_0: assembly {
sgt
and
iszero
tag_35
tag_34
jumpi
tag_35
tag_31
tag_34
tag_3
jump\t// in
tag_35:
tag_34:
shl(0xff, 0x01)
dup4
swap1
@@ -712,19 +703,19 @@ sub_0: assembly {
dup2
and
iszero
tag_37
tag_36
jumpi
tag_37
tag_31
tag_36
tag_3
jump\t// in
tag_37:
tag_36:
pop
pop
add
swap1
jump\t// out
/* \"C\":304:341 modifier m()... */
tag_19:
tag_6:
0x00
/* \"D\":91:166 contract D is C(3)... */
dup1
@@ -737,13 +728,15 @@ sub_0: assembly {
dup2
eq
iszero
tag_40
tag_39
jumpi
tag_40
tag_31
tag_39
tag_3
jump\t// in
tag_40:
tag_39:
/* \"C\":117:119 41 */
0x01
/* \"D\":91:166 contract D is C(3)... */
add
dup1
dup3
@@ -752,14 +745,14 @@ sub_0: assembly {
address
/* \"C\":403:411 this.f() */
extcodesize
tag_41
tag_40
jumpi
/* \"D\":91:166 contract D is C(3)... */
dup2
dup3
revert
/* \"C\":403:411 this.f() */
tag_41:
tag_40:
/* \"D\":91:166 contract D is C(3)... */
mload(0x40)
shl(0xe4, 0x026121ff)
@@ -779,7 +772,7 @@ sub_0: assembly {
gas
staticcall
dup1
tag_42
tag_41
jumpi
/* \"D\":91:166 contract D is C(3)... */
mload(0x40)
@@ -791,13 +784,13 @@ sub_0: assembly {
dup2
revert
/* \"C\":403:411 this.f() */
tag_42:
tag_41:
/* \"D\":91:166 contract D is C(3)... */
dup4
/* \"C\":403:411 this.f() */
dup2
iszero
tag_43
tag_42
jumpi
returndatasize
/* \"D\":91:166 contract D is C(3)... */
@@ -805,7 +798,6 @@ sub_0: assembly {
add
not(0x1f)
and
/* \"C\":117:119 41 */
dup4
add
0xffffffffffffffff
@@ -816,10 +808,9 @@ sub_0: assembly {
lt
or
iszero
tag_44
tag_43
jumpi
shl(0xe0, 0x4e487b71)
/* \"D\":91:166 contract D is C(3)... */
dup7
mstore
0x41
@@ -830,31 +821,28 @@ sub_0: assembly {
0x24
dup7
revert
/* \"C\":117:119 41 */
tag_44:
/* \"D\":91:166 contract D is C(3)... */
tag_43:
0x40
/* \"C\":117:119 41 */
mstore
/* \"C\":403:411 this.f() */
tag_45
tag_44
returndatasize
dup5
add
dup5
tag_24
tag_7
jump\t// in
tag_45:
tag_44:
swap1
pop
tag_43:
tag_42:
/* \"C\":392:411 stateVar + this.f() */
tag_46
tag_45
dup2
dup6
tag_32
tag_5
jump\t// in
tag_46:
tag_45:
swap5
pop
pop
@@ -862,14 +850,14 @@ sub_0: assembly {
pop
pop
/* \"C\":392:422 stateVar + this.f() + immutVar */
tag_47
tag_46
/* \"C\":414:422 immutVar */
immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\")
/* \"C\":392:422 stateVar + this.f() + immutVar */
dup3
tag_32
tag_5
jump\t// in
tag_47:
tag_46:
/* \"C\":336:337 _ */
swap2
pop
@@ -878,10 +866,26 @@ sub_0: assembly {
swap1
jump\t// out
/* \"D\":91:166 contract D is C(3)... */
tag_31:
mstore(0x00, shl(0xe0, 0x4e487b71))
mstore(0x04, 0x11)
revert(0x00, 0x24)
tag_7:
0x00
0x20
dup3
dup5
sub
slt
iszero
tag_48
jumpi
0x00
dup1
revert
tag_48:
pop
mload
swap2
swap1
pop
jump\t// out
auxdata: <AUXDATA REMOVED>
}
@@ -0,0 +1,22 @@
{
"language": "Solidity",
"sources":
{
"C":
{
"content": "//SPDX-License-Identifier: GPL-2.0\npragma solidity >=0.0;\npragma abicoder v2;\n\ncontract C\n{\n int public constant constVar = 41;\n int immutable immutVar = 42;\n int public stateVar;\n\n constructor(int _init)\n {\n stateVar = _init;\n }\n\n function f() external pure returns (int)\n {\n return constVar + immutVar;\n }\n modifier m()\n {\n stateVar++;\n _;\n }\n function f2() m public returns (int)\n {\n return stateVar + this.f() + immutVar;\n }\n}\n"
},
"D":
{
"content": "//SPDX-License-Identifier: GPL-2.0\npragma solidity >=0.0;\npragma abicoder v2;\nimport \"C\";\n\ncontract D is C(3)\n{\n constructor(int _init2)\n {\n stateVar += _init2;\n }\n}\n"
}
},
"settings":
{
"outputSelection":
{
"*": { "*": ["ir", "irOptimized"] }
},
"optimizer": { "enabled": true }
}
}
@@ -1 +1 @@
{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"functionDebugData":{}},"deployedBytecode":{"functionDebugData":{"@f_19":{"entryPoint":96,"id":19,"parameterSlots":1,"returnSlots":1},"abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":171,"id":null,"parameterSlots":3,"returnSlots":1},"abi_decode_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":283,"id":null,"parameterSlots":2,"returnSlots":1},"abi_decode_t_uint256":{"entryPoint":329,"id":null,"parameterSlots":2,"returnSlots":1},"abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":350,"id":null,"parameterSlots":2,"returnSlots":1},"abi_encode_t_uint256_to_t_uint256_fromStack":{"entryPoint":423,"id":null,"parameterSlots":2,"returnSlots":0},"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed":{"entryPoint":438,"id":null,"parameterSlots":2,"returnSlots":1},"allocate_memory":{"entryPoint":465,"id":null,"parameterSlots":1,"returnSlots":1},"allocate_unbounded":{"entryPoint":492,"id":null,"parameterSlots":0,"returnSlots":1},"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":502,"id":null,"parameterSlots":1,"returnSlots":1},"checked_add_t_uint256":{"entryPoint":546,"id":null,"parameterSlots":2,"returnSlots":1},"cleanup_t_uint256":{"entryPoint":632,"id":null,"parameterSlots":1,"returnSlots":1},"finalize_allocation":{"entryPoint":642,"id":null,"parameterSlots":2,"returnSlots":0},"panic_error_0x11":{"entryPoint":691,"id":null,"parameterSlots":0,"returnSlots":0},"panic_error_0x32":{"entryPoint":738,"id":null,"parameterSlots":0,"returnSlots":0},"panic_error_0x41":{"entryPoint":785,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d":{"entryPoint":832,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef":{"entryPoint":837,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db":{"entryPoint":842,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b":{"entryPoint":847,"id":null,"parameterSlots":0,"returnSlots":0},"round_up_to_mul_of_32":{"entryPoint":852,"id":null,"parameterSlots":1,"returnSlots":1},"validator_revert_t_uint256":{"entryPoint":869,"id":null,"parameterSlots":1,"returnSlots":0}}}}}}},"sources":{"a.sol":{"id":0}}}
{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"functionDebugData":{}},"deployedBytecode":{"functionDebugData":{"@f_19":{"entryPoint":96,"id":19,"parameterSlots":1,"returnSlots":1},"abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":439,"id":null,"parameterSlots":3,"returnSlots":1},"abi_decode_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":544,"id":null,"parameterSlots":2,"returnSlots":1},"abi_decode_t_uint256":{"entryPoint":418,"id":null,"parameterSlots":2,"returnSlots":1},"abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":590,"id":null,"parameterSlots":2,"returnSlots":1},"abi_encode_t_uint256_to_t_uint256_fromStack":{"entryPoint":663,"id":null,"parameterSlots":2,"returnSlots":0},"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed":{"entryPoint":678,"id":null,"parameterSlots":2,"returnSlots":1},"allocate_memory":{"entryPoint":309,"id":null,"parameterSlots":1,"returnSlots":1},"allocate_unbounded":{"entryPoint":171,"id":null,"parameterSlots":0,"returnSlots":1},"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":336,"id":null,"parameterSlots":1,"returnSlots":1},"checked_add_t_uint256":{"entryPoint":799,"id":null,"parameterSlots":2,"returnSlots":1},"cleanup_t_uint256":{"entryPoint":385,"id":null,"parameterSlots":1,"returnSlots":1},"finalize_allocation":{"entryPoint":260,"id":null,"parameterSlots":2,"returnSlots":0},"panic_error_0x11":{"entryPoint":752,"id":null,"parameterSlots":0,"returnSlots":0},"panic_error_0x32":{"entryPoint":705,"id":null,"parameterSlots":0,"returnSlots":0},"panic_error_0x41":{"entryPoint":213,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d":{"entryPoint":191,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef":{"entryPoint":380,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db":{"entryPoint":186,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b":{"entryPoint":181,"id":null,"parameterSlots":0,"returnSlots":0},"round_up_to_mul_of_32":{"entryPoint":196,"id":null,"parameterSlots":1,"returnSlots":1},"validator_revert_t_uint256":{"entryPoint":395,"id":null,"parameterSlots":1,"returnSlots":0}}}}}}},"sources":{"a.sol":{"id":0}}}
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
--no-optimize-yul
@@ -0,0 +1 @@
Option --no-optimize-yul is only valid in compiler and assembler modes.
@@ -0,0 +1 @@
1
@@ -0,0 +1 @@
--optimize
@@ -0,0 +1 @@
Option --optimize is only valid in compiler and assembler modes.
@@ -0,0 +1 @@
1
@@ -0,0 +1 @@
--optimize-runs 1000
@@ -0,0 +1 @@
Option --optimize-runs is only valid in compiler and assembler modes.
@@ -0,0 +1 @@
1
@@ -0,0 +1 @@
--optimize-yul
@@ -0,0 +1 @@
Option --optimize-yul is only valid in compiler and assembler modes.
@@ -0,0 +1 @@
1
@@ -0,0 +1 @@
--yul-optimizations a
@@ -0,0 +1 @@
Option --yul-optimizations is only valid in compiler and assembler modes.
@@ -0,0 +1 @@
1
@@ -5,10 +5,10 @@
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:\"A\", 1:\"#utility.yul\"
/// @use-src 0:\"A\"
object \"C_7\" {
code {
/// @src 0:79:121
/// @src 0:79:121 \"contract C { function f() public pure {} }\"
mstore(64, 128)
if callvalue()
{
@@ -20,14 +20,15 @@ object \"C_7\" {
return(_1, datasize(\"C_7_deployed\"))
function allocate_unbounded() -> memPtr
{ memPtr := mload(64) }
function constructor_C_7()
{ }
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb()
{ revert(0, 0) }
function constructor_C_7()
{ }
}
/// @use-src 0:\"A\"
object \"C_7_deployed\" {
code {
/// @src 0:79:121
/// @src 0:79:121 \"contract C { function f() public pure {} }\"
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
@@ -48,6 +49,14 @@ object \"C_7\" {
}
if iszero(calldatasize()) { }
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
function shift_right_224_unsigned(value) -> newValue
{ newValue := shr(224, value) }
function allocate_unbounded() -> memPtr
{ memPtr := mload(64) }
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb()
{ revert(0, 0) }
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b()
{ revert(0, 0) }
function abi_decode_tuple_(headStart, dataEnd)
{
if slt(sub(dataEnd, headStart), 0)
@@ -57,20 +66,11 @@ object \"C_7\" {
}
function abi_encode_tuple__to__fromStack(headStart) -> tail
{ tail := add(headStart, 0) }
function allocate_unbounded() -> memPtr
{ memPtr := mload(64) }
/// @src 0:92:119
function fun_f_6()
{ }
/// @src 0:79:121
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
{ revert(0, 0) }
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb()
{ revert(0, 0) }
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b()
{ revert(0, 0) }
function shift_right_224_unsigned(value) -> newValue
{ newValue := shr(224, value) }
/// @ast-id 6 @src 0:92:119 \"function f() public pure {}\"
function fun_f_6()
{ }
}
data \".metadata\" hex\"<BYTECODE REMOVED>\"
}
@@ -6,10 +6,10 @@
*=====================================================*/
/// @use-src 0:\"A\", 1:\"#utility.yul\"
/// @use-src 0:\"A\"
object \"C_7\" {
code {
/// @src 0:79:121
/// @src 0:79:121 \"contract C { function f() public pure {} }\"
mstore(64, 128)
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
@@ -24,22 +24,23 @@ object \"C_7\" {
memPtr := mload(64)
}
/// @src 0:79:121
function constructor_C_7() {
/// @src 0:79:121
}
/// @src 0:79:121
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
revert(0, 0)
}
/// @src 0:79:121 \"contract C { function f() public pure {} }\"
function constructor_C_7() {
/// @src 0:79:121 \"contract C { function f() public pure {} }\"
}
/// @src 0:79:121 \"contract C { function f() public pure {} }\"
}
/// @use-src 0:\"A\"
object \"C_7_deployed\" {
code {
/// @src 0:79:121
/// @src 0:79:121 \"contract C { function f() public pure {} }\"
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
@@ -64,13 +65,10 @@ object \"C_7\" {
if iszero(calldatasize()) { }
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
function abi_decode_tuple_(headStart, dataEnd) {
if slt(sub(dataEnd, headStart), 0) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
function shift_right_224_unsigned(value) -> newValue {
newValue :=
}
function abi_encode_tuple__to__fromStack(headStart ) -> tail {
tail := add(headStart, 0)
shr(224, value)
}
@@ -78,16 +76,6 @@ object \"C_7\" {
memPtr := mload(64)
}
/// @src 0:92:119
function fun_f_6() {
}
/// @src 0:79:121
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
revert(0, 0)
}
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
revert(0, 0)
}
@@ -96,13 +84,27 @@ object \"C_7\" {
revert(0, 0)
}
function shift_right_224_unsigned(value) -> newValue {
newValue :=
shr(224, value)
function abi_decode_tuple_(headStart, dataEnd) {
if slt(sub(dataEnd, headStart), 0) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
}
function abi_encode_tuple__to__fromStack(headStart ) -> tail {
tail := add(headStart, 0)
}
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
revert(0, 0)
}
/// @ast-id 6
/// @src 0:92:119 \"function f() public pure {}\"
function fun_f_6() {
}
/// @src 0:79:121 \"contract C { function f() public pure {} }\"
}
data \".metadata\" hex\"<BYTECODE REMOVED>\"
@@ -1,13 +1,13 @@
{"errors":[{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:12:7:
|
12 | \t\t\t\t\t\tassert(x > 0);
@@ -16,10 +16,10 @@ test.f(0, 1)
","message":"CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":258,"file":"A","start":245},"type":"Warning"}],"sources":{"A":{"id":0}}}
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":258,"file":"A","start":245},"type":"Warning"}],"sources":{"A":{"id":0}}}
@@ -126,13 +126,13 @@
"}},"errors":[{"component":"general","errorCode":"4281","formattedMessage":"Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:10:7:
|
10 | \t\t\t\t\t\t2 / x;
@@ -141,22 +141,22 @@ test.f(0, 1)
","message":"CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":216,"file":"A","start":211},"type":"Warning"},{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":216,"file":"A","start":211},"type":"Warning"},{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:12:7:
|
12 | \t\t\t\t\t\tassert(x > 0);
@@ -165,22 +165,22 @@ test.f(0, 1)
","message":"CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":258,"file":"A","start":245},"type":"Warning"},{"component":"general","errorCode":"2529","formattedMessage":"Warning: CHC: Empty array \"pop\" happens here.
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":258,"file":"A","start":245},"type":"Warning"},{"component":"general","errorCode":"2529","formattedMessage":"Warning: CHC: Empty array \"pop\" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:13:7:
|
13 | \t\t\t\t\t\tarr.pop();
@@ -189,22 +189,22 @@ test.f(0, 1)
","message":"CHC: Empty array \"pop\" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":275,"file":"A","start":266},"type":"Warning"},{"component":"general","errorCode":"6368","formattedMessage":"Warning: CHC: Out of bounds access happens here.
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":275,"file":"A","start":266},"type":"Warning"},{"component":"general","errorCode":"6368","formattedMessage":"Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:14:7:
|
14 | \t\t\t\t\t\tarr[x];
@@ -213,13 +213,13 @@ test.f(0, 1)
","message":"CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":289,"file":"A","start":283},"type":"Warning"},{"component":"general","errorCode":"6838","formattedMessage":"Warning: BMC: Condition is always true.
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":289,"file":"A","start":283},"type":"Warning"},{"component":"general","errorCode":"6838","formattedMessage":"Warning: BMC: Condition is always true.
--> A:7:15:
|
7 | \t\t\t\t\t\trequire(x >= 0);
@@ -1,13 +1,13 @@
{"errors":[{"component":"general","errorCode":"4281","formattedMessage":"Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:10:7:
|
10 | \t\t\t\t\t\t2 / x;
@@ -16,22 +16,22 @@ test.f(0, 1)
","message":"CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":216,"file":"A","start":211},"type":"Warning"},{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":216,"file":"A","start":211},"type":"Warning"},{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:12:7:
|
12 | \t\t\t\t\t\tassert(x > 0);
@@ -40,22 +40,22 @@ test.f(0, 1)
","message":"CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":258,"file":"A","start":245},"type":"Warning"},{"component":"general","errorCode":"2529","formattedMessage":"Warning: CHC: Empty array \"pop\" happens here.
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":258,"file":"A","start":245},"type":"Warning"},{"component":"general","errorCode":"2529","formattedMessage":"Warning: CHC: Empty array \"pop\" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:13:7:
|
13 | \t\t\t\t\t\tarr.pop();
@@ -64,22 +64,22 @@ test.f(0, 1)
","message":"CHC: Empty array \"pop\" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":275,"file":"A","start":266},"type":"Warning"},{"component":"general","errorCode":"6368","formattedMessage":"Warning: CHC: Out of bounds access happens here.
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":275,"file":"A","start":266},"type":"Warning"},{"component":"general","errorCode":"6368","formattedMessage":"Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:14:7:
|
14 | \t\t\t\t\t\tarr[x];
@@ -88,10 +88,10 @@ test.f(0, 1)
","message":"CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":289,"file":"A","start":283},"type":"Warning"}],"sources":{"A":{"id":0}}}
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":289,"file":"A","start":283},"type":"Warning"}],"sources":{"A":{"id":0}}}
@@ -1,13 +1,13 @@
{"errors":[{"component":"general","errorCode":"4281","formattedMessage":"Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:10:7:
|
10 | \t\t\t\t\t\t2 / x;
@@ -16,10 +16,10 @@ test.f(0, 1)
","message":"CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":216,"file":"A","start":211},"type":"Warning"}],"sources":{"A":{"id":0}}}
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":216,"file":"A","start":211},"type":"Warning"}],"sources":{"A":{"id":0}}}

Some files were not shown because too many files have changed in this diff Show More