Skip to content

Commit c2215d4

Browse files
authored
Merge pull request #2667 from ethereum/develop
Merge develop into release in proparation for 0.4.14
2 parents 0fb4cb1 + 2abfdb6 commit c2215d4

File tree

194 files changed

+17492
-1581
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+17492
-1581
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include(EthPolicy)
88
eth_policy()
99

1010
# project name and version should be set after cmake_policy CMP0048
11-
set(PROJECT_VERSION "0.4.13")
11+
set(PROJECT_VERSION "0.4.14")
1212
project(solidity VERSION ${PROJECT_VERSION})
1313

1414
# Let's find our dependencies

Changelog.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
### 0.4.14 (2017-07-31)
2+
3+
Features:
4+
* C API (``jsonCompiler``): Export the ``license`` method.
5+
* Code Generator: Optimise the fallback function, by removing a useless jump.
6+
* Inline Assembly: Show useful error message if trying to access calldata variables.
7+
* Inline Assembly: Support variable declaration without initial value (defaults to 0).
8+
* Metadata: Only include files which were used to compile the given contract.
9+
* Type Checker: Disallow value transfers to contracts without a payable fallback function.
10+
* Type Checker: Include types in explicit conversion error message.
11+
* Type Checker: Raise proper error for arrays too large for ABI encoding.
12+
* Type checker: Warn if using ``this`` in a constructor.
13+
* Type checker: Warn when existing symbols, including builtins, are overwritten.
14+
15+
Bugfixes:
16+
* Code Generator: Properly clear return memory area for ecrecover.
17+
* Type Checker: Fix crash for some assignment to non-lvalue.
18+
* Type Checker: Fix invalid "specify storage keyword" warning for reference members of structs.
19+
* Type Checker: Mark modifiers as internal.
20+
* Type Checker: Re-allow multiple mentions of the same modifier per function.
21+
22+
123
### 0.4.13 (2017-07-06)
224

325
Features:

ReleaseChecklist.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Checklist for making a release:
2+
3+
- [ ] Check that all "nextrelease" issues and pull requests are merged to ``develop``.
4+
- [ ] Create a commit in ``develop`` that updates the ``Changelog`` to include a release date (run the tests locally to update the bug list).
5+
- [ ] Create a pull request and wait for the tests, merge it.
6+
- [ ] Create a pull request from ``develop`` to ``release``, wait for the tests, then merge it.
7+
- [ ] Make a final check that there are no platform-dependency issues in the ``solc-test-bytecode`` repository.
8+
- [ ] Wait for the tests for the commit on ``release``, create a release in Github, creating the tag.
9+
- [ ] Thank voluntary contributors in the Github release page (use ``git shortlog -s -n -e origin/release..origin/develop``).
10+
- [ ] Wait for the CI runs on the tag itself (they should push artefacts onto the Github release page).
11+
- [ ] Run ``scripts/release_ppa.sh release`` to create the PPA release (you need the relevant openssl key).
12+
- [ ] Check that the Docker release was pushed to Docker Hub (this still seems to have problems).
13+
- [ ] Update the homebrew realease in https://github.com/ethereum/homebrew-ethereum/blob/master/solidity.rb (version and hash)
14+
- [ ] Make a release of ``solc-js``: Increment the version number, create a pull request for that, merge it after tests succeeded.
15+
- [ ] Run ``npm publish`` in the updated ``solc-js`` repository.
16+
- [ ] Create a commit to increase the version number on ``develop`` in ``CMakeLists.txt`` and add a new skeleton changelog entry.
17+
- [ ] Merge ``release`` back into ``develop``.
18+
- [ ] Announce on Twitter and Reddit.
19+
- [ ] Lean back, wait for bug reports and repeat from step 1 :)

cmake/EthCompilerSettings.cmake

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,24 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
160160
endif()
161161

162162
if (EMSCRIPTEN)
163-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --memory-init-file 0 -O3 -s LINKABLE=1 -s DISABLE_EXCEPTION_CATCHING=0 -s NO_EXIT_RUNTIME=1 -s ALLOW_MEMORY_GROWTH=1 -s NO_DYNAMIC_EXECUTION=1")
164-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -ffunction-sections -Wl,--gc-sections")
165-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
166-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_FILESYSTEM=1 -s AGGRESSIVE_VARIABLE_ELIMINATION=1")
163+
# Do emit a separate memory initialiser file
164+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --memory-init-file 0")
165+
# Leave only exported symbols as public and agressively remove others
166+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -ffunction-sections -Wl,--gc-sections -fvisibility=hidden")
167+
# Optimisation level
168+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
169+
# Re-enable exception catching (optimisations above -O1 disable it)
170+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s DISABLE_EXCEPTION_CATCHING=0")
171+
# Remove any code related to exit (such as atexit)
172+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_EXIT_RUNTIME=1")
173+
# Remove any code related to filesystem access
174+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_FILESYSTEM=1")
175+
# Remove variables even if it needs to be duplicated (can improve speed at the cost of size)
176+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s AGGRESSIVE_VARIABLE_ELIMINATION=1")
177+
# Allow memory growth, but disable some optimisations
178+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s ALLOW_MEMORY_GROWTH=1")
179+
# Disable eval()
180+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_DYNAMIC_EXECUTION=1")
167181
add_definitions(-DETH_EMSCRIPTEN=1)
168182
endif()
169183
endif()

docs/abi-spec.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
Application Binary Interface Specification
77
******************************************
88

9-
Basic design
9+
Basic Design
1010
============
1111

1212
The Application Binary Interface is the standard way to interact with contracts in the Ethereum ecosystem, both
13-
from outside the blockchain and for contract-to-contract interaction. Data is encoded following its type,
14-
according to this specification.
13+
from outside the blockchain and for contract-to-contract interaction. Data is encoded according to its type,
14+
as described in this specification. The encoding is not self describing and thus requires a schema in order to decode.
1515

16-
We assume the Application Binary Interface (ABI) is strongly typed, known at compilation time and static. No introspection mechanism will be provided. We assert that all contracts will have the interface definitions of any contracts they call available at compile-time.
16+
We assume the interface functions of a contract are strongly typed, known at compilation time and static. No introspection mechanism will be provided. We assume that all contracts will have the interface definitions of any contracts they call available at compile-time.
1717

1818
This specification does not address contracts whose interface is dynamic or otherwise known only at run-time. Should these cases become important they can be adequately handled as facilities built within the Ethereum ecosystem.
1919

@@ -58,7 +58,7 @@ The following (fixed-size) array type exists:
5858

5959
- `<type>[M]`: a fixed-length array of the given fixed-length type.
6060

61-
The following non-fixed-size types exist:
61+
The following non-fixed-size types exist:
6262

6363
- `bytes`: dynamic sized byte sequence.
6464

@@ -93,6 +93,7 @@ We distinguish static and dynamic types. Static types are encoded in-place and d
9393
* `string`
9494
* `T[]` for any `T`
9595
* `T[k]` for any dynamic `T` and any `k > 0`
96+
* `(T1,...,Tk)` if any `Ti` is dynamic for `1 <= i <= k`
9697

9798
All other types are called "static".
9899

@@ -181,6 +182,8 @@ Given the contract:
181182

182183
::
183184

185+
pragma solidity ^0.4.0;
186+
184187
contract Foo {
185188
function bar(bytes3[2] xy) {}
186189
function baz(uint32 x, bool y) returns (bool r) { r = x > 32 || y; }
@@ -313,6 +316,8 @@ For example,
313316

314317
::
315318

319+
pragma solidity ^0.4.0;
320+
316321
contract Test {
317322
function Test(){ b = 0x12345678901234567890123456789012; }
318323
event Event(uint indexed a, bytes32 b)
@@ -334,10 +339,6 @@ would result in the JSON:
334339
"inputs": [{"name":"a","type":"uint256","indexed":true},{"name":"b","type":"bytes32","indexed":false}],
335340
"name":"Event2"
336341
}, {
337-
"type":"event",
338-
"inputs": [{"name":"a","type":"uint256","indexed":true},{"name":"b","type":"bytes32","indexed":false}],
339-
"name":"Event2"
340-
}, {
341342
"type":"function",
342343
"inputs": [{"name":"a","type":"uint256"}],
343344
"name":"foo",

docs/assembly.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ you really know what you are doing.
9292
function sumAsm(uint[] _data) returns (uint o_sum) {
9393
for (uint i = 0; i < _data.length; ++i) {
9494
assembly {
95-
o_sum := mload(add(add(_data, 0x20), mul(i, 0x20)))
95+
o_sum := add(o_sum, mload(add(add(_data, 0x20), mul(i, 0x20))))
9696
}
9797
}
9898
}
@@ -110,7 +110,7 @@ these curly braces, the following can be used (see the later sections for more d
110110
- opcodes (in "instruction style"), e.g. ``mload sload dup1 sstore``, for a list see below
111111
- opcodes in functional style, e.g. ``add(1, mlod(0))``
112112
- labels, e.g. ``name:``
113-
- variable declarations, e.g. ``let x := 7`` or ``let x := add(y, 3)``
113+
- variable declarations, e.g. ``let x := 7``, ``let x := add(y, 3)`` or ``let x`` (initial value of empty (0) is assigned)
114114
- identifiers (labels or assembly-local variables and externals if used as inline assembly), e.g. ``jump(name)``, ``3 x add``
115115
- assignments (in "instruction style"), e.g. ``3 =: x``
116116
- assignments in functional style, e.g. ``x := add(y, 3)``
@@ -490,7 +490,7 @@ is performed by replacing the variable's value on the stack by the new value.
490490

491491
.. code::
492492
493-
assembly {
493+
{
494494
let v := 0 // functional-style assignment as part of variable declaration
495495
let g := add(v, 2)
496496
sload(10)
@@ -509,7 +509,7 @@ case called ``default``.
509509

510510
.. code::
511511
512-
assembly {
512+
{
513513
let x := 0
514514
switch calldataload(4)
515515
case 0 {
@@ -538,7 +538,7 @@ The following example computes the sum of an area in memory.
538538

539539
.. code::
540540
541-
assembly {
541+
{
542542
let x := 0
543543
for { let i := 0 } lt(i, 0x100) { i := add(i, 0x20) } {
544544
x := add(x, mload(i))
@@ -565,7 +565,7 @@ The following example implements the power function by square-and-multiply.
565565

566566
.. code::
567567
568-
assembly {
568+
{
569569
function power(base, exponent) -> result {
570570
switch exponent
571571
case 0 { result := 1 }
@@ -679,6 +679,8 @@ Example:
679679
We will follow an example compilation from Solidity to desugared assembly.
680680
We consider the runtime bytecode of the following Solidity program::
681681

682+
pragma solidity ^0.4.0;
683+
682684
contract C {
683685
function f(uint x) returns (uint y) {
684686
y = 1;
@@ -965,7 +967,7 @@ adjustment. Every time a new
965967
local variable is introduced, it is registered together with the current
966968
stack height. If a variable is accessed (either for copying its value or for
967969
assignment), the appropriate DUP or SWAP instruction is selected depending
968-
on the difference bitween the current stack height and the
970+
on the difference between the current stack height and the
969971
stack height at the point the variable was introduced.
970972

971973
Pseudocode::

docs/bugs.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
[
2+
{
3+
"name": "ECRecoverMalformedInput",
4+
"summary": "The ecrecover() builtin can return garbage for malformed input.",
5+
"description": "The ecrecover precompile does not properly signal failure for malformed input (especially in the 'v' argument) and thus the Solidity function can return data that was previously present in the return area in memory.",
6+
"fixed": "0.4.14",
7+
"severity": "medium"
8+
},
29
{
310
"name": "SkipEmptyStringLiteral",
411
"summary": "If \"\" is used in a function call, the following function arguments will not be correctly passed to the function.",
@@ -107,4 +114,4 @@
107114
"severity": "high",
108115
"fixed": "0.3.0"
109116
}
110-
]
117+
]

0 commit comments

Comments
 (0)