Skip to content

Commit 9cf6e91

Browse files
authored
Merge pull request ethereum#3099 from ethereum/develop
Merge develop into release for 0.4.18.
2 parents bdeb9e5 + c85c418 commit 9cf6e91

File tree

99 files changed

+3258
-1432
lines changed

Some content is hidden

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

99 files changed

+3258
-1432
lines changed

.travis.yml

-7
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@ env:
4949

5050
matrix:
5151
include:
52-
# Ubuntu 14.04 LTS "Trusty Tahr"
53-
# https://en.wikipedia.org/wiki/List_of_Ubuntu_releases#Ubuntu_14.04_LTS_.28Trusty_Tahr.29
54-
#
55-
# TravisCI doesn't directly support any new Ubuntu releases. These is
56-
# some Docker support, which we should probably investigate, at least for
57-
# Ubuntu 16.04 LTS "Xenial Xerus"
58-
# See https://en.wikipedia.org/wiki/List_of_Ubuntu_releases#Ubuntu_16.04_LTS_.28Xenial_Xerus.29.
5952
- os: linux
6053
dist: trusty
6154
sudo: required

CMakeLists.txt

+2-2
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.17")
11+
set(PROJECT_VERSION "0.4.18")
1212
project(solidity VERSION ${PROJECT_VERSION})
1313

1414
option(SOLC_LINK_STATIC "Link solc executable statically on supported platforms" OFF)
@@ -35,7 +35,7 @@ string(REGEX MATCHALL ".." LICENSE_TEXT "${LICENSE_TEXT}")
3535
string(REGEX REPLACE ";" ",\n\t0x" LICENSE_TEXT "${LICENSE_TEXT}")
3636
set(LICENSE_TEXT "0x${LICENSE_TEXT}")
3737

38-
configure_file("${CMAKE_SOURCE_DIR}/cmake/templates/license.h.in" "license.h")
38+
configure_file("${CMAKE_SOURCE_DIR}/cmake/templates/license.h.in" include/license.h)
3939

4040
include(EthOptions)
4141
configure_project(TESTS)

Changelog.md

+28
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
### 0.4.18 (2017-10-18)
2+
3+
Features:
4+
* Code Generator: Always use all available gas for calls as experimental 0.5.0 feature
5+
(previously, some amount was retained in order to work in pre-Tangerine-Whistle
6+
EVM versions)
7+
* Parser: Better error message for unexpected trailing comma in parameter lists.
8+
* Standard JSON: Support the ``outputSelection`` field for selective compilation of supplied sources.
9+
* Syntax Checker: Unary ``+`` is now a syntax error as experimental 0.5.0 feature.
10+
* Type Checker: Disallow non-pure constant state variables as experimental 0.5.0 feature.
11+
* Type Checker: Do not add members of ``address`` to contracts as experimental 0.5.0 feature.
12+
* Type Checker: Force interface functions to be external as experimental 0.5.0 feature.
13+
* Type Checker: Require ``storage`` or ``memory`` keyword for local variables as experimental 0.5.0 feature.
14+
15+
Bugfixes:
16+
* Code Generator: Allocate one byte per memory byte array element instead of 32.
17+
* Code Generator: Do not accept data with less than four bytes (truncated function
18+
signature) for regular function calls - fallback function is invoked instead.
19+
* Optimizer: Remove unused stack computation results.
20+
* Parser: Fix source location of VariableDeclarationStatement.
21+
* Type Checker: Allow ``gas`` in view functions.
22+
* Type Checker: Do not mark event parameters as shadowing state variables.
23+
* Type Checker: Prevent duplicate event declarations.
24+
* Type Checker: Properly check array length and don't rely on an assertion in code generation.
25+
* Type Checker: Properly support overwriting members inherited from ``address`` in a contract
26+
(such as ``balance``, ``transfer``, etc.)
27+
* Type Checker: Validate each number literal in tuple expressions even if they are not assigned from.
28+
129
### 0.4.17 (2017-09-21)
230

331
Features:

appveyor.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ environment:
4747
#init:
4848
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
4949
install:
50-
- ps: $fileContent = "-----BEGIN RSA PRIVATE KEY-----`n"
51-
- ps: $fileContent += $env:priv_key.Replace(' ', "`n")
52-
- ps: $fileContent += "`n-----END RSA PRIVATE KEY-----`n"
53-
- ps: Set-Content c:\users\appveyor\.ssh\id_rsa $fileContent
50+
- ps: if ($env:priv_key) {
51+
$fileContent = "-----BEGIN RSA PRIVATE KEY-----`n";
52+
$fileContent += $env:priv_key.Replace(' ', "`n");
53+
$fileContent += "`n-----END RSA PRIVATE KEY-----`n";
54+
Set-Content c:\users\appveyor\.ssh\id_rsa $fileContent
55+
}
5456
- git submodule update --init --recursive
5557
- ps: $prerelease = "nightly."
5658
- ps: $prerelease += Get-Date -format "yyyy.M.d"
@@ -66,12 +68,15 @@ build_script:
6668
- cd %APPVEYOR_BUILD_FOLDER%
6769
- scripts\release.bat %CONFIGURATION%
6870
- ps: $bytecodedir = git show -s --format="%cd-%H" --date=short
69-
- ps: scripts\bytecodecompare\storebytecode.bat $Env:CONFIGURATION $bytecodedir
71+
# Skip bytecode compare if private key is not available
72+
- ps: if ($env:priv_key) {
73+
scripts\bytecodecompare\storebytecode.bat $Env:CONFIGURATION $bytecodedir
74+
}
7075

7176
test_script:
7277
- cd %APPVEYOR_BUILD_FOLDER%
7378
- cd %APPVEYOR_BUILD_FOLDER%\build\test\%CONFIGURATION%
74-
- soltest.exe --show-progress -- --no-ipc
79+
- soltest.exe --show-progress -- --no-ipc --no-smt
7580

7681
artifacts:
7782
- path: solidity-windows.zip

cmake/EthBuildInfo.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ function(create_build_info NAME)
3939
-DPROJECT_VERSION="${PROJECT_VERSION}"
4040
-P "${ETH_SCRIPTS_DIR}/buildinfo.cmake"
4141
)
42-
include_directories(BEFORE ${PROJECT_BINARY_DIR})
42+
include_directories("${PROJECT_BINARY_DIR}/include")
4343
endfunction()

cmake/EthCheckCXXCompilerFlag.cmake

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
include(CheckCXXCompilerFlag)
2+
3+
# Adds CXX compiler flag if the flag is supported by the compiler.
4+
#
5+
# This is effectively a combination of CMake's check_cxx_compiler_flag()
6+
# and add_compile_options():
7+
#
8+
# if(check_cxx_compiler_flag(flag))
9+
# add_compile_options(flag)
10+
#
11+
function(eth_add_cxx_compiler_flag_if_supported FLAG)
12+
# Remove leading - or / from the flag name.
13+
string(REGEX REPLACE "^-|/" "" name ${FLAG})
14+
check_cxx_compiler_flag(${FLAG} ${name})
15+
if(${name})
16+
add_compile_options(${FLAG})
17+
endif()
18+
19+
# If the optional argument passed, store the result there.
20+
if(ARGV1)
21+
set(${ARGV1} ${name} PARENT_SCOPE)
22+
endif()
23+
endfunction()

cmake/EthCompilerSettings.cmake

+7-16
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# CMake file for cpp-ethereum project which specifies our compiler settings
55
# for each supported platform and build configuration.
66
#
7-
# See http://www.ethdocs.org/en/latest/ethereum-clients/cpp-ethereum/.
7+
# The documentation for cpp-ethereum is hosted at http://cpp-ethereum.org
88
#
99
# Copyright (c) 2014-2016 cpp-ethereum contributors.
1010
#------------------------------------------------------------------------------
@@ -14,18 +14,15 @@
1414
#
1515
# These settings then end up spanning all POSIX platforms (Linux, OS X, BSD, etc)
1616

17-
include(CheckCXXCompilerFlag)
17+
include(EthCheckCXXCompilerFlag)
1818

19-
check_cxx_compiler_flag(-fstack-protector-strong have_stack_protector_strong)
20-
if (have_stack_protector_strong)
21-
add_compile_options(-fstack-protector-strong)
22-
else()
23-
check_cxx_compiler_flag(-fstack-protector have_stack_protector)
24-
if(have_stack_protector)
25-
add_compile_options(-fstack-protector)
26-
endif()
19+
eth_add_cxx_compiler_flag_if_supported(-fstack-protector-strong have_stack_protector_strong_support)
20+
if(NOT have_stack_protector_strong_support)
21+
eth_add_cxx_compiler_flag_if_supported(-fstack-protector)
2722
endif()
2823

24+
eth_add_cxx_compiler_flag_if_supported(-Wimplicit-fallthrough)
25+
2926
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
3027

3128
# Use ISO C++11 standard language.
@@ -83,12 +80,6 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
8380
message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.7 or greater.")
8481
endif ()
8582

86-
# Until https://github.com/ethereum/solidity/issues/2479 is handled
87-
# disable all implicit fallthrough warnings in the codebase for GCC > 7.0
88-
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
89-
add_compile_options(-Wno-implicit-fallthrough)
90-
endif()
91-
9283
# Additional Clang-specific compiler settings.
9384
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
9485

cmake/EthDependencies.cmake

-7
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,3 @@ option(Boost_USE_STATIC_LIBS "Link Boost statically" ON)
4848
find_package(Boost 1.54.0 QUIET REQUIRED COMPONENTS regex filesystem unit_test_framework program_options system)
4949

5050
eth_show_dependency(Boost boost)
51-
52-
if (APPLE)
53-
link_directories(/usr/local/lib)
54-
include_directories(/usr/local/include)
55-
endif()
56-
57-
include_directories(BEFORE "${PROJECT_BINARY_DIR}/include")

docs/abi-spec.rst

+20-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ Events
279279

280280
Events are an abstraction of the Ethereum logging/event-watching protocol. Log entries provide the contract's address, a series of up to four topics and some arbitrary length binary data. Events leverage the existing function ABI in order to interpret this (together with an interface spec) as a properly typed structure.
281281

282-
Given an event name and series of event parameters, we split them into two sub-series: those which are indexed and those which are not. Those which are indexed, which may number up to 3, are used alongside the Keccak hash of the event signature to form the topics of the log entry. Those which as not indexed form the byte array of the event.
282+
Given an event name and series of event parameters, we split them into two sub-series: those which are indexed and those which are not. Those which are indexed, which may number up to 3, are used alongside the Keccak hash of the event signature to form the topics of the log entry. Those which are not indexed form the byte array of the event.
283283

284284
In effect, a log entry using this ABI is described as:
285285

@@ -442,3 +442,22 @@ would result in the JSON:
442442
"outputs": []
443443
}
444444
]
445+
446+
.. _abi_packed_mode:
447+
448+
Non-standard Packed Mode
449+
========================
450+
451+
Solidity supports a non-standard packed mode where:
452+
453+
- no :ref:`function selector <abi_function_selector>` is encoded,
454+
- short types are not zero padded and
455+
- dynamic types are encoded in-place and without the length.
456+
457+
As an example encoding ``uint1, bytes1, uint8, string`` with values ``1, 0x42, 0x2424, "Hello, world!"`` results in ::
458+
459+
0x0142242448656c6c6f2c20776f726c6421
460+
^^ uint1(1)
461+
^^ bytes1(0x42)
462+
^^^^ uint8(0x2424)
463+
^^^^^^^^^^^^^^^^^^^^^^^^^^ string("Hello, world!") without a length field

docs/bugs.json

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
[
2+
{
3+
"name": "ZeroFunctionSelector",
4+
"summary": "It is possible to craft the name of a function such that it is executed instead of the fallback function in very specific circumstances.",
5+
"description": "If a function has a selector consisting only of zeros, is payable and part of a contract that does not have a fallback function and at most five external functions in total, this function is called instead of the fallback function if Ether is sent to the contract without data.",
6+
"fixed": "0.4.18",
7+
"severity": "very low"
8+
},
29
{
310
"name": "DelegateCallReturnValue",
411
"summary": "The low-level .delegatecall() does not return the execution outcome, but converts the value returned by the functioned called to a boolean instead.",

docs/bugs.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fixed
4848
publish
4949
The date at which the bug became known publicly, optional
5050
severity
51-
Severity of the bug: low, medium, high. Takes into account
51+
Severity of the bug: very low, low, medium, high. Takes into account
5252
discoverability in contract tests, likelihood of occurrence and
5353
potential damage by exploits.
5454
conditions

0 commit comments

Comments
 (0)