Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Nov 21, 2016
2 parents 4633f3d + 5ebd31c commit b318366
Show file tree
Hide file tree
Showing 102 changed files with 3,087 additions and 659 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,8 @@ git:
cache:
ccache: true
directories:
- cryptopp
- boost_1_57_0
- build
- jsoncpp

install:
- test $TRAVIS_INSTALL_DEPS != On || ./scripts/install_deps.sh
Expand All @@ -164,7 +162,7 @@ script:
# in Solidity's RPC setup and some will be in 'eth'. It seems unlikely that Solidity
# itself is broken from the failure messages which we are seeing.
#
# More details on known issues at https://github.com/ethereum/solidity/issues/769
# More details on known issues at https://github.com/ethereum/solidity/issues/769
- test $TRAVIS_TESTS != On || (cd $TRAVIS_BUILD_DIR && (./scripts/tests.sh || ./scripts/tests.sh || ./scripts/tests.sh) )
env:
global:
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ include(EthPolicy)
eth_policy()

# project name and version should be set after cmake_policy CMP0048
set(PROJECT_VERSION "0.4.4")
set(PROJECT_VERSION "0.4.5")
project(solidity VERSION ${PROJECT_VERSION})

# Let's find our dependencies
include(EthDependencies)
include(deps/jsoncpp.cmake)

# Figure out what compiler and system are we using
include(EthCompilerSettings)
Expand Down
17 changes: 17 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
### 0.4.5 (2016-11-21)

Features:
* Function types
* Do-while loops: support for a ``do <block> while (<expr>);`` control structure
* Inline assembly: support ``invalidJumpLabel`` as a jump label.
* Type checker: now more eagerly searches for a common type of an inline array with mixed types
* Code generator: generates a runtime error when an out-of-range value is converted into an enum type.

Bugfixes:

* Inline assembly: calculate stack height warning correctly even when local variables are used.
* Code generator: check for value transfer in non-payable constructors.
* Parser: disallow empty enum definitions.
* Type checker: disallow conversion between different enum types.
* Interface JSON: do not include trailing new line.

### 0.4.4 (2016-10-31)

Bugfixes:
Expand Down
5 changes: 2 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

branches:
only:
- master
- release
- develop
os: Visual Studio 2015
configuration:
Expand Down Expand Up @@ -83,14 +83,13 @@ artifacts:
# below.

deploy:
description: 'Development build of solidity at commit $(APPVEYOR_REPO_COMMIT).\n\n$(APPVEYOR_REPO_COMMIT_MESSAGE)\n\nCommitted by $(APPVEYOR_REPO_COMMIT_AUTHOR), $(APPVEYOR_REPO_COMMIT_TIMESTAMP).'
prerelease: true
provider: GitHub
auth_token:
secure: HPjiugbDSCsEFTphj/qwHuSw80/BV1xWoSvj95CPmtb16Ukh2VQbLVB7iFtZSans
artifact: solidity-windows-zip
on:
branch: release
appveyor_repo_tag: true

notifications:
- provider: GitHubPullRequest
Expand Down
2 changes: 1 addition & 1 deletion cmake/EthCompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
add_compile_options(-fPIC)

# Configuration-specific compiler settings.
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DETH_DEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g -DETH_DEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
Expand Down
50 changes: 0 additions & 50 deletions cmake/FindJsoncpp.cmake

This file was deleted.

10 changes: 0 additions & 10 deletions cmake/UseJsoncpp.cmake

This file was deleted.

3 changes: 1 addition & 2 deletions cmake/UseSolidity.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ function(eth_apply TARGET REQUIRED SUBMODULE)
target_include_directories(${TARGET} PUBLIC ${Solidity_INCLUDE_DIRS})

if (${SUBMODULE} STREQUAL "solevmasm")
eth_use(${TARGET} ${REQUIRED} Jsoncpp)
target_link_libraries(${TARGET} ${Solidity_SOLEVMASM_LIBRARIES})
target_link_libraries(${TARGET} ${Solidity_SOLEVMASM_LIBRARIES} jsoncpp)
endif()

if (${SUBMODULE} STREQUAL "lll")
Expand Down
2 changes: 1 addition & 1 deletion deps
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ def setup(sphinx):
# built documents.
#
# The short X.Y version.
version = '0.4.4'
version = '0.4.5'
# The full version, including alpha/beta/rc tags.
release = '0.4.4-develop'
release = '0.4.5-develop'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
17 changes: 11 additions & 6 deletions docs/control-structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
Expressions and Control Structures
##################################

.. index:: if, else, while, for, break, continue, return, switch, goto
.. index:: if, else, while, do/while, for, break, continue, return, switch, goto

Control Structures
===================

Most of the control structures from C or JavaScript are available in Solidity
except for ``switch`` and ``goto``. So
there is: ``if``, ``else``, ``while``, ``for``, ``break``, ``continue``, ``return``, ``? :``, with
there is: ``if``, ``else``, ``while``, ``do``, ``for``, ``break``, ``continue``, ``return``, ``? :``, with
the usual semantics known from C or JavaScript.

Parentheses can *not* be omitted for conditionals, but curly brances can be omitted
Expand Down Expand Up @@ -329,9 +329,10 @@ Currently, there are situations, where exceptions happen automatically in Solidi
3. If you call a function via a message call but it does not finish properly (i.e. it runs out of gas, has no matching function, or throws an exception itself), except when a low level operation ``call``, ``send``, ``delegatecall`` or ``callcode`` is used. The low level operations never throw exceptions but indicate failures by returning ``false``.
4. If you create a contract using the ``new`` keyword but the contract creation does not finish properly (see above for the definition of "not finish properly").
5. If you divide or modulo by zero (e.g. ``5 / 0`` or ``23 % 0``).
6. If you perform an external function call targeting a contract that contains no code.
7. If your contract receives Ether via a public function without ``payable`` modifier (including the constructor and the fallback function).
8. If your contract receives Ether via a public accessor function.
6. If you convert a value too big or negative into an enum type.
7. If you perform an external function call targeting a contract that contains no code.
8. If your contract receives Ether via a public function without ``payable`` modifier (including the constructor and the fallback function).
9. If your contract receives Ether via a public accessor function.

Internally, Solidity performs an "invalid jump" when an exception is thrown and thus causes the EVM to revert all changes made to the state. The reason for this is that there is no safe way to continue execution, because an expected effect did not occur. Because we want to retain the atomicity of transactions, the safest thing to do is to revert all changes and make the whole transaction (or at least call) without effect.

Expand Down Expand Up @@ -426,7 +427,7 @@ these curly braces, the following can be used (see the later sections for more d

- literals, e.g. ``0x123``, ``42`` or ``"abc"`` (strings up to 32 characters)
- opcodes (in "instruction style"), e.g. ``mload sload dup1 sstore``, for a list see below
- opcodes in functional style, e.g. ``add(1, mlod(0))``
- opcodes in functional style, e.g. ``add(1, mload(0))``
- labels, e.g. ``name:``
- variable declarations, e.g. ``let x := 7`` or ``let x := add(y, 3)``
- identifiers (externals, labels or assembly-local variables), e.g. ``jump(name)``, ``3 x add``
Expand Down Expand Up @@ -715,6 +716,10 @@ will have a wrong impression about the stack height at label ``two``:
three:
}
.. note::

``invalidJumpLabel`` is a pre-defined label. Jumping to this location will always
result in an invalid jump, effectively aborting execution of the code.

Declaring Assembly-Local Variables
----------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/introduction-to-smart-contracts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Storage
storedData = x;
}

function get() constant returns (uint retVal) {
function get() constant returns (uint) {
return storedData;
}
}
Expand Down Expand Up @@ -136,7 +136,7 @@ like this one. The accessor function created by the ``public`` keyword
is a bit more complex in this case. It roughly looks like the
following::

function balances(address _account) returns (uint balance) {
function balances(address _account) returns (uint) {
return balances[_account];
}

Expand Down
9 changes: 9 additions & 0 deletions docs/solidity-by-example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,15 @@ of votes.
}
}
}
// Calls winningProposal() function to get the index
// of the winner contained in the proposals array and then
// returns the name of the winner
function winnerName() constant
returns (bytes32 winnerName)
{
winnerName = proposals[winningProposal()].name;
}
}

Possible Improvements
Expand Down
Loading

0 comments on commit b318366

Please sign in to comment.