Skip to content

Commit e560f70

Browse files
authored
Merge pull request #6853 from ethereum/develop
Merge develop inte release for 0.5.9
2 parents 23d335f + b716b21 commit e560f70

File tree

656 files changed

+15364
-4712
lines changed

Some content is hidden

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

656 files changed

+15364
-4712
lines changed

.circleci/config.yml

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ defaults:
3030
command: scripts/tests.sh --junit_report test_results
3131
- run_regressions: &run_regressions
3232
name: Regression tests
33-
command: scripts/regressions.py -o test_results
33+
command: |
34+
export ASAN_OPTIONS="check_initialization_order=true:detect_stack_use_after_return=true:strict_init_order=true:strict_string_checks=true:detect_invalid_pointer_pairs=2"
35+
scripts/regressions.py -o test_results
3436
- solc_artifact: &solc_artifact
3537
path: build/solc/solc
3638
destination: solc
@@ -43,12 +45,14 @@ defaults:
4345
- ossfuzz_artifacts: &ossfuzz_artifacts
4446
root: build
4547
paths:
46-
- test/tools/ossfuzz/solc_opt_ossfuzz
47-
- test/tools/ossfuzz/solc_noopt_ossfuzz
4848
- test/tools/ossfuzz/const_opt_ossfuzz
49+
- test/tools/ossfuzz/solc_noopt_ossfuzz
50+
- test/tools/ossfuzz/solc_opt_ossfuzz
51+
- test/tools/ossfuzz/strictasm_assembly_ossfuzz
4952
- test/tools/ossfuzz/strictasm_diff_ossfuzz
50-
- test/tools/ossfuzz/yul_proto_ossfuzz
53+
- test/tools/ossfuzz/strictasm_opt_ossfuzz
5154
- test/tools/ossfuzz/yul_proto_diff_ossfuzz
55+
- test/tools/ossfuzz/yul_proto_ossfuzz
5256

5357
version: 2
5458
jobs:
@@ -134,6 +138,24 @@ jobs:
134138
command: |
135139
test/externalTests/zeppelin.sh /tmp/workspace/soljson.js || test/externalTests/zeppelin.sh /tmp/workspace/soljson.js
136140
141+
test_emscripten_external_colony:
142+
docker:
143+
- image: circleci/node:10
144+
environment:
145+
TERM: xterm
146+
steps:
147+
- checkout
148+
- attach_workspace:
149+
at: /tmp/workspace
150+
- run:
151+
name: Install test dependencies
152+
command: |
153+
sudo apt-get -qy install lsof
154+
- run:
155+
name: External ColonyNetworks tests
156+
command: |
157+
test/externalTests/colony.sh /tmp/workspace/soljson.js || test/externalTests/colony.sh /tmp/workspace/soljson.js
158+
137159
build_x86_linux:
138160
docker:
139161
- image: buildpack-deps:bionic
@@ -337,13 +359,15 @@ jobs:
337359
ulimit -a
338360
# Increase stack size because ASan makes stack frames bigger and that breaks our assumptions (in tests).
339361
ulimit -s 16384
362+
export ASAN_OPTIONS="check_initialization_order=true:detect_stack_use_after_return=true:strict_init_order=true:strict_string_checks=true:detect_invalid_pointer_pairs=2"
340363
build/test/soltest --logger=JUNIT,test_suite,test_results/result.xml -- --no-ipc --testpath test
341364
- run:
342365
name: Run commandline tests with ASAN
343366
command: |
344367
ulimit -a
345368
# Increase stack size because ASan makes stack frames bigger and that breaks our assumptions (in tests).
346369
ulimit -s 16384
370+
export ASAN_OPTIONS="check_initialization_order=true:detect_stack_use_after_return=true:strict_init_order=true:strict_string_checks=true:detect_invalid_pointer_pairs=2"
347371
test/cmdlineTests.sh
348372
- store_test_results:
349373
path: test_results/
@@ -416,28 +440,30 @@ jobs:
416440

417441
build_x86_linux_ossfuzz:
418442
docker:
419-
- image: buildpack-deps:cosmic
443+
- image: buildpack-deps:disco
420444
environment:
421445
TERM: xterm
422-
CC: /usr/bin/clang-7
423-
CXX: /usr/bin/clang++-7
446+
CC: /usr/bin/clang-8
447+
CXX: /usr/bin/clang++-8
424448
CMAKE_OPTIONS: -DOSSFUZZ=1 -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/libfuzzer.cmake
425449
steps:
426450
- checkout
427451
- run:
428452
name: Install build dependencies
429453
command: |
430454
apt-get -qq update
431-
apt-get -qy install clang-7 cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libcvc4-dev libbz2-dev ninja-build zlib1g-dev libjsoncpp-dev=1.7.4-\*
455+
apt-get -qy install wget clang-8 cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libcvc4-dev libbz2-dev ninja-build zlib1g-dev libjsoncpp-dev=1.7.4-\*
432456
./scripts/install_lpm.sh
433457
./scripts/install_libfuzzer.sh
458+
# Install evmone and dependencies (intx and ethash)
459+
./scripts/install_evmone.sh
434460
- run: *setup_prerelease_commit_hash
435461
- run: *run_build_ossfuzz
436462
- persist_to_workspace: *ossfuzz_artifacts
437463

438464
test_x86_ossfuzz_regression:
439465
docker:
440-
- image: buildpack-deps:cosmic
466+
- image: buildpack-deps:disco
441467
environment:
442468
TERM: xterm
443469
steps:
@@ -448,13 +474,11 @@ jobs:
448474
name: Install dependencies
449475
command: |
450476
apt-get -qq update
451-
apt-get -qy install libcvc4-dev llvm-7-dev
477+
apt-get -qy install libcvc4-dev llvm-8-dev
452478
./scripts/download_ossfuzz_corpus.sh
453-
update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-7 1
479+
update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-8 1
454480
- run: mkdir -p test_results
455481
- run: *run_regressions
456-
- store_test_results:
457-
path: test_results/
458482
- store_artifacts:
459483
path: test_results/
460484
destination: test_results/
@@ -471,14 +495,6 @@ workflows:
471495
<<: *build_on_tags
472496
requires:
473497
- build_emscripten
474-
- test_emscripten_external_zeppelin:
475-
<<: *build_on_tags
476-
requires:
477-
- build_emscripten
478-
- test_emscripten_external_gnosis:
479-
<<: *build_on_tags
480-
requires:
481-
- build_emscripten
482498
- build_x86_linux: *build_on_tags
483499
- build_x86_linux_cxx17: *build_on_tags
484500
- build_x86_clang7_asan: *build_on_tags
@@ -521,8 +537,13 @@ workflows:
521537
<<: *build_on_tags
522538
requires:
523539
- build_emscripten
540+
- test_emscripten_external_colony:
541+
<<: *build_on_tags
542+
requires:
543+
- build_emscripten
524544
- build_x86_linux_ossfuzz: *build_on_tags
525545
- test_x86_ossfuzz_regression:
526546
<<: *build_on_tags
527547
requires:
528548
- build_x86_linux_ossfuzz
549+

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ Please provide a *minimal* source code example to trigger the bug you have found
3333
Please also mention any command line flags that are necessary for triggering the bug.
3434
Provide as much information as necessary to reproduce the bug.
3535
36-
```
36+
```solidity
3737
// Some *minimal* Solidity source code to reproduce the bug.
3838
// ...
3939
```
40-
-->
40+
-->

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ include(EthPolicy)
1010
eth_policy()
1111

1212
# project name and version should be set after cmake_policy CMP0048
13-
set(PROJECT_VERSION "0.5.8")
13+
set(PROJECT_VERSION "0.5.9")
1414
project(solidity VERSION ${PROJECT_VERSION} LANGUAGES CXX)
1515

1616
option(LLL "Build LLL" OFF)

Changelog.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
### 0.5.9 (2019-05-28)
2+
3+
Language Features:
4+
* Inline Assembly: Revert change introduced in 0.5.7: The ``callvalue()`` instruction does not require ``payable`` anymore.
5+
* Static Analyzer: Disallow libraries calling themselves externally.
6+
7+
8+
Compiler Features:
9+
* Assembler: Encode the compiler version in the deployed bytecode.
10+
* Code Generator: Fix handling of structs of dynamic size as constructor parameters.
11+
* Commandline Interface: Experimental parser error recovery via the ``--error-recovery`` commandline switch.
12+
* Inline Assembly: Disallow the combination of ``msize()`` and the Yul optimizer.
13+
* Metadata: Add IPFS hashes of source files.
14+
* Optimizer: Add rule to simplify SHL/SHR combinations.
15+
* Optimizer: Add rules for multiplication and division by left-shifted one.
16+
* SMTChecker: Support inherited state variables.
17+
* SMTChecker: Support tuples and function calls with multiple return values.
18+
* SMTChecker: Support ``delete``.
19+
* SMTChecker: Inline external function calls to ``this``.
20+
* Yul Optimizer: Simplify single-run ``for`` loops to ``if`` statements.
21+
* Yul Optimizer: Optimize representation of numbers.
22+
* Yul Optimizer: Do not inline recursive functions.
23+
* Yul Optimizer: Do not remove instructions that affect ``msize()`` if ``msize()`` is used.
24+
25+
Bugfixes:
26+
* Code Generator: Explicitly turn uninitialized internal function pointers into invalid functions when loaded from storage.
27+
* Code Generator: Fix assertion failure when assigning structs containing array of mapping.
28+
* Compiler Internals: Reset the Yul string repository before each compilation, freeing up memory.
29+
* SMTChecker: Fix bad cast in base constructor modifier.
30+
* SMTChecker: Fix internal error when visiting state variable inherited from base class.
31+
* SMTChecker: Fix internal error in fixed point operations.
32+
* SMTChecker: Fix internal error in assignment to unsupported type.
33+
* SMTChecker: Fix internal error in branching when inlining function calls that modify local variables.
34+
35+
136
### 0.5.8 (2019-04-30)
237

338
Important Bugfixes:
@@ -33,6 +68,7 @@ Bugfixes:
3368
* SMTChecker: SSA control-flow did not take into account state variables that were modified inside inlined functions that were called inside branches.
3469
* Type System: Use correct type name for contracts in event parameters when used in libraries. This affected code generation.
3570
* Type System: Allow direct call to base class functions that have overloads.
71+
* Type System: Warn about shadowing builtin variables if user variables are named ``this`` or ``super``.
3672
* Yul: Properly register functions and disallow shadowing between function variables and variables in the outside scope.
3773

3874

cmake/EthBuildInfo.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ function(create_build_info NAME)
3737
-DETH_BUILD_COMPILER="${ETH_BUILD_COMPILER}"
3838
-DETH_BUILD_PLATFORM="${ETH_BUILD_PLATFORM}"
3939
-DPROJECT_VERSION="${PROJECT_VERSION}"
40+
-DPROJECT_VERSION_MAJOR="${PROJECT_VERSION_MAJOR}"
41+
-DPROJECT_VERSION_MINOR="${PROJECT_VERSION_MINOR}"
42+
-DPROJECT_VERSION_PATCH="${PROJECT_VERSION_PATCH}"
4043
-P "${ETH_SCRIPTS_DIR}/buildinfo.cmake"
4144
)
4245
include_directories("${PROJECT_BINARY_DIR}/include")

cmake/EthCompilerSettings.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,13 @@ else ()
144144
endif ()
145145

146146
if (SANITIZE)
147-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=${SANITIZE}")
147+
# Perform case-insensitive string compare
148+
string(TOLOWER "${SANITIZE}" san)
149+
# -fno-omit-frame-pointer gives more informative stack trace in case of an error
150+
# -fsanitize-address-use-after-scope throws an error when a variable is used beyond its scope
151+
if (san STREQUAL "address")
152+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=address -fsanitize-address-use-after-scope")
153+
endif()
148154
endif()
149155

150156
# Code coverage support.

cmake/templates/BuildInfo.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#pragma once
22

33
#define ETH_PROJECT_VERSION "@PROJECT_VERSION@"
4+
#define ETH_PROJECT_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
5+
#define ETH_PROJECT_VERSION_MINOR @PROJECT_VERSION_MINOR@
6+
#define ETH_PROJECT_VERSION_PATCH @PROJECT_VERSION_PATCH@
47
#define SOL_COMMIT_HASH "@SOL_COMMIT_HASH@"
58
#define ETH_BUILD_TYPE "@ETH_BUILD_TYPE@"
69
#define ETH_BUILD_OS "@ETH_BUILD_OS@"

cmake/templates/license.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jsoncpp:
6767
license you like.
6868

6969
scanner/token:
70-
The liblangutil/{CharStream,Scanner,Token}.{h,cpp} files are dervied from
70+
The liblangutil/{CharStream,Scanner,Token}.{h,cpp} files are derived from
7171
code originating from the V8 project licensed under the following terms:
7272

7373
Copyright 2006-2012, the V8 project authors. All rights reserved.

docs/abi-spec.rst

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,11 @@ Given the contract:
214214

215215
pragma solidity >=0.4.16 <0.7.0;
216216

217+
217218
contract Foo {
218-
function bar(bytes3[2] memory) public pure {}
219-
function baz(uint32 x, bool y) public pure returns (bool r) { r = x > 32 || y; }
220-
function sam(bytes memory, bool, uint[] memory) public pure {}
219+
function bar(bytes3[2] memory) public pure {}
220+
function baz(uint32 x, bool y) public pure returns (bool r) { r = x > 32 || y; }
221+
function sam(bytes memory, bool, uint[] memory) public pure {}
221222
}
222223

223224

@@ -485,12 +486,13 @@ For example,
485486

486487
pragma solidity >=0.5.0 <0.7.0;
487488

489+
488490
contract Test {
489-
constructor() public { b = hex"12345678901234567890123456789012"; }
490-
event Event(uint indexed a, bytes32 b);
491-
event Event2(uint indexed a, bytes32 b);
492-
function foo(uint a) public { emit Event(a, b); }
493-
bytes32 b;
491+
constructor() public { b = hex"12345678901234567890123456789012"; }
492+
event Event(uint indexed a, bytes32 b);
493+
event Event2(uint indexed a, bytes32 b);
494+
function foo(uint a) public { emit Event(a, b); }
495+
bytes32 b;
494496
}
495497

496498
would result in the JSON:
@@ -533,11 +535,12 @@ As an example, the code
533535
pragma solidity >=0.4.19 <0.7.0;
534536
pragma experimental ABIEncoderV2;
535537

538+
536539
contract Test {
537-
struct S { uint a; uint[] b; T[] c; }
538-
struct T { uint x; uint y; }
539-
function f(S memory s, T memory t, uint a) public;
540-
function g() public returns (S memory s, T memory t, uint a);
540+
struct S { uint a; uint[] b; T[] c; }
541+
struct T { uint x; uint y; }
542+
function f(S memory s, T memory t, uint a) public;
543+
function g() public returns (S memory s, T memory t, uint a);
541544
}
542545

543546
would result in the JSON:

0 commit comments

Comments
 (0)