diff options
| -rw-r--r-- | .travis.yml | 2 | ||||
| -rw-r--r-- | Changelog.md | 4 | ||||
| -rw-r--r-- | appveyor.yml | 2 | ||||
| -rw-r--r-- | docs/contributing.rst | 8 | ||||
| -rw-r--r-- | libsolidity/codegen/ContractCompiler.cpp | 3 | ||||
| -rw-r--r-- | libsolidity/interface/StandardCompiler.cpp | 8 | ||||
| -rwxr-xr-x | scripts/bytecodecompare/storebytecode.sh | 3 | ||||
| -rwxr-xr-x | scripts/create_source_tarball.sh | 4 | ||||
| -rwxr-xr-x | scripts/release_ppa.sh | 24 | ||||
| -rw-r--r-- | snap/snapcraft.yaml | 29 | ||||
| -rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 27 |
11 files changed, 98 insertions, 16 deletions
diff --git a/.travis.yml b/.travis.yml index c0371af2..315d29bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -180,7 +180,7 @@ cache: install: - test $SOLC_INSTALL_DEPS_TRAVIS != On || (scripts/install_deps.sh) - test "$TRAVIS_OS_NAME" != "linux" || (scripts/install_cmake.sh) - - if [ "$TRAVIS_BRANCH" = release ]; then echo -n > prerelease.txt; else date -u +"nightly.%Y.%-m.%-d" > prerelease.txt; fi + - if [ "$TRAVIS_BRANCH" = release -o -n "$TRAVIS_TAG" ]; then echo -n > prerelease.txt; else date -u +"nightly.%Y.%-m.%-d" > prerelease.txt; fi - echo -n "$TRAVIS_COMMIT" > commit_hash.txt before_script: diff --git a/Changelog.md b/Changelog.md index 7c0c86a5..de4207a9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,9 @@ ### 0.4.13 (unreleased) +Bugfixes: + * Code Generator: Correctly unregister modifier variables. + * Error Output: Do not omit the error type. + ### 0.4.12 (2017-07-03) Features: diff --git a/appveyor.yml b/appveyor.yml index 55c80a21..3d4d65bb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -54,7 +54,7 @@ install: - git submodule update --init --recursive - ps: $prerelease = "nightly." - ps: $prerelease += Get-Date -format "yyyy.M.d" - - ps: Set-Content prerelease.txt $prerelease + - ps: if($env:appveyor_repo_branch -eq 'release') { Set-Content prerelease.txt $null } else { Set-Content prerelease.txt $prerelease } - scripts/install_deps.bat - set ETHEREUM_DEPS_PATH=%APPVEYOR_BUILD_FOLDER%\deps\install before_build: diff --git a/docs/contributing.rst b/docs/contributing.rst index 559f9f6a..9d1b2ce3 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -78,10 +78,10 @@ Alternatively, there is a testing script at ``scripts/test.sh`` which executes a Whiskers ======== -*Whiskers* is a templating system similar to `Moustache <https://mustache.github.io>`_. It is used by the +*Whiskers* is a templating system similar to `Mustache <https://mustache.github.io>`_. It is used by the compiler in various places to aid readability, and thus maintainability and verifiability, of the code. -The syntax comes with a substantial difference to Moustache: the template markers ``{{`` and ``}}`` are +The syntax comes with a substantial difference to Mustache: the template markers ``{{`` and ``}}`` are replaced by ``<`` and ``>`` in order to aid parsing and avoid conflicts with :ref:`inline-assembly` (The symbols ``<`` and ``>`` are invalid in inline assembly, while ``{`` and ``}`` are used to delimit blocks). Another limitation is that lists are only resolved one depth and they will not recurse. This may change in the future. @@ -91,5 +91,5 @@ A rough specification is the following: Any occurrence of ``<name>`` is replaced by the string-value of the supplied variable ``name`` without any escaping and without iterated replacements. An area can be delimited by ``<#name>...</name>``. It is replaced by as many concatenations of its contents as there were sets of variables supplied to the template system, -each time replacing any ``<inner>`` items by their respective value. Top-level variales can also be used -inside such areas.
\ No newline at end of file +each time replacing any ``<inner>`` items by their respective value. Top-level variables can also be used +inside such areas. diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index c358a519..cad388df 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -928,7 +928,10 @@ void ContractCompiler::appendModifierOrFunctionCode() ); } for (VariableDeclaration const* localVariable: modifier.localVariables()) + { + addedVariables.push_back(localVariable); appendStackVariableInitialisation(*localVariable); + } stackSurplus = CompilerUtils::sizeOnStack(modifier.parameters()) + diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp index e677afc8..1f51851d 100644 --- a/libsolidity/interface/StandardCompiler.cpp +++ b/libsolidity/interface/StandardCompiler.cpp @@ -71,7 +71,7 @@ Json::Value formatErrorWithException( ) { string message; - string formattedMessage = SourceReferenceFormatter::formatExceptionInformation(_exception, _message, _scannerFromSourceName); + string formattedMessage = SourceReferenceFormatter::formatExceptionInformation(_exception, _type, _scannerFromSourceName); // NOTE: the below is partially a copy from SourceReferenceFormatter SourceLocation const* location = boost::get_error_info<errinfo_sourceLocation>(_exception); @@ -271,12 +271,12 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input) for (auto const& error: m_compilerStack.errors()) { - auto err = dynamic_pointer_cast<Error const>(error); + Error const& err = dynamic_cast<Error const&>(*error); errors.append(formatErrorWithException( *error, - err->type() == Error::Type::Warning, - err->typeName(), + err.type() == Error::Type::Warning, + err.typeName(), "general", "", scannerFromSourceName diff --git a/scripts/bytecodecompare/storebytecode.sh b/scripts/bytecodecompare/storebytecode.sh index 564de3f8..8d4100bf 100755 --- a/scripts/bytecodecompare/storebytecode.sh +++ b/scripts/bytecodecompare/storebytecode.sh @@ -98,9 +98,8 @@ EOF REPORT="$DIRNAME/$ZIP_SUFFIX.txt" cp ../report.txt "$REPORT" # Only push if adding actually worked, i.e. there were changes. - if git add "$REPORT" + if git add "$REPORT" && git commit -a -m "Added report $REPORT" then - git commit -a -m "Added report $REPORT" git pull --rebase git push origin else diff --git a/scripts/create_source_tarball.sh b/scripts/create_source_tarball.sh index 7339e106..9e66799a 100755 --- a/scripts/create_source_tarball.sh +++ b/scripts/create_source_tarball.sh @@ -26,6 +26,10 @@ REPO_ROOT="$(dirname "$0")"/.. git submodule foreach 'git checkout-index -a --prefix="'"$SOLDIR"'/$path/"' # Store the commit hash echo "$commithash" > "$SOLDIR/commit_hash.txt" + if [ -e prerelease.txt -a ! -s prerelease.txt ] + then + cp prerelease.txt "$SOLDIR/" + fi # Add dependencies mkdir -p "$SOLDIR/deps/downloads/" 2>/dev/null || true wget -O "$SOLDIR/deps/downloads/jsoncpp-1.7.7.tar.gz" https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz diff --git a/scripts/release_ppa.sh b/scripts/release_ppa.sh index 7c9abecb..4fae90ef 100755 --- a/scripts/release_ppa.sh +++ b/scripts/release_ppa.sh @@ -15,6 +15,21 @@ ## It will clone the Solidity git from github, determine the version, ## create a source archive and push it to the ubuntu ppa servers. ## +## This requires the following entries in /etc/dput.cf: +## +## [ethereum-dev] +## fqdn = ppa.launchpad.net +## method = ftp +## incoming = ~ethereum/ethereum-dev +## login = anonymous +## +## [ethereum] +## fqdn = ppa.launchpad.net +## method = ftp +## incoming = ~ethereum/ethereum +## login = anonymous + +## ############################################################################## set -ev @@ -28,10 +43,10 @@ fi if [ "$branch" = develop ] then - pparepo=ethereum/ethereum-dev + pparepo=ethereum-dev ppafilesurl=https://launchpad.net/~ethereum/+archive/ubuntu/ethereum-dev/+files else - pparepo=ethereum/ethereum + pparepo=ethereum ppafilesurl=https://launchpad.net/~ethereum/+archive/ubuntu/ethereum/+files fi @@ -192,7 +207,8 @@ EMAIL="$email" dch -v 1:${debversion}-${versionsuffix} "git build of ${commithas # build source package # If packages is rejected because original source is already present, add # -sd to remove it from the .changes file -debuild -S -sa -us -uc +# -d disables the build dependencies check +debuild -S -d -sa -us -uc # prepare .changes file for Launchpad sed -i -e s/UNRELEASED/${distribution}/ -e s/urgency=medium/urgency=low/ ../*.changes @@ -223,6 +239,6 @@ fi debsign --re-sign -k ${keyid} ../${packagename}_${debversion}-${versionsuffix}_source.changes # upload -dput ppa:${pparepo} ../${packagename}_${debversion}-${versionsuffix}_source.changes +dput ${pparepo} ../${packagename}_${debversion}-${versionsuffix}_source.changes done diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 00000000..f0f3310a --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,29 @@ +name: solc +version: master +summary: The Solidity Contract-Oriented Programming Language +description: | + Solidity is a contract-oriented, high-level language whose syntax is similar + to that of JavaScript and it is designed to target the Ethereum Virtual + Machine (EVM). + + Solidity is statically typed, supports inheritance, libraries and complex + user-defined types among other features. + + It is possible to create contracts for voting, crowdfunding, blind auctions, + multi-signature wallets and more. + +grade: devel # must be 'stable' to release into candidate/stable channels +confinement: strict + +apps: + solc: + command: solc + plugs: [home] + +parts: + solidity: + source: . + source-type: git + plugin: cmake + build-packages: [build-essential, libboost-all-dev] + stage-packages: [libicu55] diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index a6c01283..c9771fbd 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -9696,6 +9696,33 @@ BOOST_AUTO_TEST_CASE(keccak256_assembly) BOOST_CHECK(callContractFunction("i()") == fromHex("0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")); } +BOOST_AUTO_TEST_CASE(multi_modifiers) +{ + // This triggered a bug in some version because the variable in the modifier was not + // unregistered correctly. + char const* sourceCode = R"( + contract C { + uint public x; + modifier m1 { + address a1 = msg.sender; + x++; + _; + } + function f1() m1() { + x += 7; + } + function f2() m1() { + x += 3; + } + } + )"; + compileAndRun(sourceCode, 0, "C"); + BOOST_CHECK(callContractFunction("f1()") == bytes()); + BOOST_CHECK(callContractFunction("x()") == encodeArgs(u256(8))); + BOOST_CHECK(callContractFunction("f2()") == bytes()); + BOOST_CHECK(callContractFunction("x()") == encodeArgs(u256(12))); +} + BOOST_AUTO_TEST_SUITE_END() } |
