Skip to content

Commit 59dbf8f

Browse files
authored
Merge pull request #4957 from ethereum/develop_v0425
Merge to release for 0.4.25
2 parents e67f014 + 76812ed commit 59dbf8f

32 files changed

+1000
-66
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ build/
3535
docs/_build
3636
docs/utils/__pycache__
3737
docs/utils/*.pyc
38+
/deps/downloads/
3839

3940
# vim stuff
4041
*.swp
@@ -43,3 +44,5 @@ docs/utils/*.pyc
4344
.idea
4445
browse.VC.db
4546
CMakeLists.txt.user
47+
/CMakeSettings.json
48+
/.vs

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

1414
option(SOLC_LINK_STATIC "Link solc executable statically on supported platforms" OFF)

Changelog.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
### 0.4.25 (2018-09-12)
2+
3+
Important Bugfixes:
4+
* Code Generator: Properly perform cleanup for exponentiation and non-256 bit types.
5+
* Type Checker: Report error when using indexed structs in events with experimental ABIEncoderV2. This used to log wrong values.
6+
* Type Checker: Report error when using structs in events without experimental ABIEncoderV2. This used to crash or log the wrong values.
7+
* Parser: Consider all unicode line terminators (LF, VF, FF, CR, NEL, LS, PS) for single-line comments
8+
and string literals. They are invalid in strings and will end comments.
9+
* Parser: Disallow unterminated multi-line comments at the end of input.
10+
* Parser: Treat ``/** /`` as unterminated multi-line comment.
11+
112
### 0.4.24 (2018-05-16)
213

314
Language Features:

circle.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,23 @@ jobs:
155155
- store_artifacts: *solc_artifact
156156
- persist_to_workspace: *all_artifacts
157157

158+
test_buglist:
159+
docker:
160+
- image: circleci/node
161+
environment:
162+
TERM: xterm
163+
steps:
164+
- checkout
165+
- run:
166+
name: JS deps
167+
command: |
168+
npm install download
169+
npm install JSONPath
170+
npm install mktemp
171+
- run:
172+
name: Test buglist
173+
command: ./test/buglistTests.js
174+
158175
test_x86_linux:
159176
docker:
160177
- image: buildpack-deps:artful
@@ -217,6 +234,7 @@ workflows:
217234
version: 2
218235
build_all:
219236
jobs:
237+
- test_buglist: *build_on_tags
220238
- build_emscripten: *build_on_tags
221239
- test_emscripten_solcjs:
222240
<<: *build_on_tags

cmake/EthCompilerSettings.cmake

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,6 @@ elseif (DEFINED MSVC)
132132
add_compile_options(-D_WIN32_WINNT=0x0600) # declare Windows Vista API requirement
133133
add_compile_options(-DNOMINMAX) # undefine windows.h MAX && MIN macros cause it cause conflicts with std::min && std::max functions
134134

135-
# Always use Release variant of C++ runtime.
136-
# We don't want to provide Debug variants of all dependencies. Some default
137-
# flags set by CMake must be tweaked.
138-
string(REPLACE "/MDd" "/MD" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
139-
string(REPLACE "/D_DEBUG" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
140-
string(REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
141-
string(REPLACE "/MDd" "/MD" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
142-
string(REPLACE "/D_DEBUG" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
143-
string(REPLACE "/RTC1" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
144-
set_property(GLOBAL PROPERTY DEBUG_CONFIGURATIONS OFF)
145-
146135
# disable empty object file warning
147136
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")
148137
# warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification

cmake/jsoncpp.cmake

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,20 @@ else()
66
set(JSONCPP_CMAKE_COMMAND ${CMAKE_COMMAND})
77
endif()
88

9-
include(GNUInstallDirs)
109
set(prefix "${CMAKE_BINARY_DIR}/deps")
11-
set(JSONCPP_LIBRARY "${prefix}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX}")
10+
set(JSONCPP_LIBRARY "${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX}")
1211
set(JSONCPP_INCLUDE_DIR "${prefix}/include")
1312

14-
if(NOT MSVC)
15-
set(JSONCPP_EXTRA_FLAGS "-std=c++11")
13+
# TODO: Investigate why this breaks some emscripten builds and
14+
# check whether this can be removed after updating the emscripten
15+
# versions used in the CI runs.
16+
if(EMSCRIPTEN)
17+
# Do not include all flags in CMAKE_CXX_FLAGS for emscripten,
18+
# but only use -std=c++11. Using all flags causes build failures
19+
# at the moment.
20+
set(JSONCPP_CXX_FLAGS -std=c++11)
21+
else()
22+
set(JSONCPP_CXX_FLAGS ${CMAKE_CXX_FLAGS})
1623
endif()
1724

1825
set(byproducts "")
@@ -30,14 +37,13 @@ ExternalProject_Add(jsoncpp-project
3037
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
3138
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
3239
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
40+
-DCMAKE_INSTALL_LIBDIR=lib
3341
# Build static lib but suitable to be included in a shared lib.
3442
-DCMAKE_POSITION_INDEPENDENT_CODE=${BUILD_SHARED_LIBS}
3543
-DJSONCPP_WITH_TESTS=OFF
3644
-DJSONCPP_WITH_PKGCONFIG_SUPPORT=OFF
37-
-DCMAKE_CXX_FLAGS=${JSONCPP_EXTRA_FLAGS}
38-
# Overwrite build and install commands to force Release build on MSVC.
39-
BUILD_COMMAND cmake --build <BINARY_DIR> --config Release
40-
INSTALL_COMMAND cmake --build <BINARY_DIR> --config Release --target install
45+
-DCMAKE_CXX_FLAGS=${JSONCPP_CXX_FLAGS}
46+
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
4147
${byproducts}
4248
)
4349

docs/bugs.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
11
[
2+
{
3+
"name": "ExpExponentCleanup",
4+
"summary": "Using the ** operator with an exponent of type shorter than 256 bits can result in unexpected values.",
5+
"description": "Higher order bits in the exponent are not properly cleaned before the EXP opcode is applied if the type of the exponent expression is smaller than 256 bits and not smaller than the type of the base. In that case, the result might be larger than expected if the exponent is assumed to lie within the value range of the type. Literal numbers as exponents are unaffected as are exponents or bases of type uint256.",
6+
"fixed": "0.4.25",
7+
"severity": "medium/high",
8+
"check": {"regex-source": "[^/]\\*\\* *[^/0-9 ]"}
9+
},
10+
{
11+
"name": "EventStructWrongData",
12+
"summary": "Using structs in events logged wrong data.",
13+
"description": "If a struct is used in an event, the address of the struct is logged instead of the actual data.",
14+
"introduced": "0.4.17",
15+
"fixed": "0.4.25",
16+
"severity": "very low",
17+
"check": {"ast-compact-json-path": "$..[?(@.nodeType === 'EventDefinition')]..[?(@.nodeType === 'UserDefinedTypeName' && @.typeDescriptions.typeString.startsWith('struct'))]"}
18+
},
19+
{
20+
"name": "PublicLibFunctionsDoNotReturnNestedArrays",
21+
"summary": "Calls to public library functions (internal functions are safe) that return nested arrays return only zeroes.",
22+
"description": "The compiler does not complain about public library functions (internal functions are safe) returning nested arrays, but it also does not return it correctly. Thus, the function caller receives only zeroes.",
23+
"introduced": "0.4.11",
24+
"fixed": "0.4.22",
25+
"severity": "low"
26+
},
227
{
328
"name": "OneOfTwoConstructorsSkipped",
429
"summary": "If a contract has both a new-style constructor (using the constructor keyword) and an old-style constructor (a function with the same name as the contract) at the same time, one of them will be ignored.",
@@ -7,6 +32,15 @@
732
"fixed": "0.4.23",
833
"severity": "very low"
934
},
35+
{
36+
"name": "NestedArrayFunctionCallDecoder",
37+
"summary": "Calling functions that return multi-dimensional fixed-size arrays can result in memory corruption.",
38+
"description": "If Solidity code calls a function that returns a multi-dimensional fixed-size array, array elements are incorrectly interpreted as memory pointers and thus can cause memory corruption if the return values are accessed. Calling functions with multi-dimensional fixed-size arrays is unaffected as is returning fixed-size arrays from function calls. The regular expression only checks if such functions are present, not if they are called, which is required for the contract to be affected.",
39+
"introduced": "0.1.4",
40+
"fixed": "0.4.22",
41+
"severity": "medium",
42+
"check": {"regex-source": "returns[^;{]*\\[\\s*[^\\] \\t\\r\\n\\v\\f][^\\]]*\\]\\s*\\[\\s*[^\\] \\t\\r\\n\\v\\f][^\\]]*\\][^{;]*[;{]"}
43+
},
1044
{
1145
"name": "ZeroFunctionSelector",
1246
"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.",

docs/bugs.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,20 @@ conditions
5656
is an object that can contain a boolean value ``optimizer``, which
5757
means that the optimizer has to be switched on to enable the bug.
5858
If no conditions are given, assume that the bug is present.
59+
check
60+
This field contains different checks that can be used to determine
61+
whether a smart contract
62+
contains the bug or not. The first type of check are Javascript regular
63+
expressions that are to be matched against the source code ("source-regex").
64+
If there is no match, then the bug is very likely
65+
not present. If there is a match, the bug might be present. For improved
66+
accuracy, the checks should be applied to the source code after stripping
67+
comments.
68+
The second type of check are patterns to be applied to the compact AST of
69+
the Solidity program ("ast-compact-json-path"). The specified search query
70+
is a `JsonPath <https://github.com/json-path/JsonPath>`_ expression.
71+
If at least one path of the Solidity AST matches the query, the bug is
72+
likely present.
5973

6074
.. literalinclude:: bugs.json
6175
:language: js

0 commit comments

Comments
 (0)