Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit af6afb0

Browse files
authored
Merge pull request argotorg#1107 from ethereum/develop
Version 0.4.2
2 parents 4fc6fc2 + a78e779 commit af6afb0

18 files changed

+276
-50
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
.commit_hash.txt
2+
.prerelease.txt
3+
14
# Compiled Object files
25
*.slo
36
*.lo

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

1414
# Let's find our dependencies

Changelog.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
### 0.4.2 (2016-09-17)
2+
3+
Bugfixes:
4+
5+
* Code Generator: Fix library functions being called from payable functions.
6+
* Type Checker: Fixed a crash about invalid array types.
7+
* Code Generator: Fixed a call gas bug that became visible after
8+
version 0.4.0 for calls where the output is larger than the input.
9+
10+
### 0.4.1 (2016-09-09)
11+
12+
* Build System: Fixes to allow library compilation.
13+
114
### 0.4.0 (2016-09-08)
215

316
This release deliberately breaks backwards compatibility mostly to

cmake/scripts/buildinfo.cmake

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ if (EXISTS ${ETH_SOURCE_DIR}/prerelease.txt)
2626
string(STRIP "${SOL_VERSION_PRERELEASE}" SOL_VERSION_PRERELEASE)
2727
else()
2828
string(TIMESTAMP SOL_VERSION_PRERELEASE "develop.%Y.%m.%d" UTC)
29+
string(REPLACE .0 . SOL_VERSION_PRERELEASE "${SOL_VERSION_PRERELEASE}")
2930
endif()
3031

3132
if (EXISTS ${ETH_SOURCE_DIR}/commit_hash.txt)
3233
file(READ ${ETH_SOURCE_DIR}/commit_hash.txt SOL_COMMIT_HASH)
3334
string(STRIP ${SOL_COMMIT_HASH} SOL_COMMIT_HASH)
3435
else()
3536
execute_process(
36-
COMMAND git --git-dir=${ETH_SOURCE_DIR}/.git --work-tree=${ETH_SOURCE_DIR} rev-parse HEAD
37+
COMMAND git --git-dir=${ETH_SOURCE_DIR}/.git --work-tree=${ETH_SOURCE_DIR} rev-parse --short=8 HEAD
3738
OUTPUT_VARIABLE SOL_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET
3839
)
3940
execute_process(
@@ -47,14 +48,17 @@ if (SOL_COMMIT_HASH)
4748
string(SUBSTRING ${SOL_COMMIT_HASH} 0 8 SOL_COMMIT_HASH)
4849
endif()
4950

50-
if (SOL_COMMIT_HASH AND SOL_LOCAL_CHANGES)
51-
set(SOL_COMMIT_HASH "${SOL_COMMIT_HASH}.mod")
52-
endif()
53-
5451
if (NOT SOL_COMMIT_HASH)
5552
message(FATAL_ERROR "Unable to determine commit hash. Either compile from within git repository or "
5653
"supply a file called commit_hash.txt")
5754
endif()
55+
if (NOT SOL_COMMIT_HASH MATCHES [a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])
56+
message(FATAL_ERROR "Malformed commit hash \"${SOL_COMMIT_HASH}\". It has to consist of exactly 8 hex digits.")
57+
endif()
58+
59+
if (SOL_COMMIT_HASH AND SOL_LOCAL_CHANGES)
60+
set(SOL_COMMIT_HASH "${SOL_COMMIT_HASH}.mod")
61+
endif()
5862

5963
set(SOL_VERSION_BUILDINFO "commit.${SOL_COMMIT_HASH}.${ETH_BUILD_PLATFORM}")
6064

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ def setup(sphinx):
5656
# built documents.
5757
#
5858
# The short X.Y version.
59-
version = '0.2.0'
59+
version = '0.4.1'
6060
# The full version, including alpha/beta/rc tags.
61-
release = '0.2.0'
61+
release = '0.4.1-develop'
6262

6363
# The language for content autogenerated by Sphinx. Refer to documentation
6464
# for a list of supported languages.

docs/installing-solidity.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
Installing Solidity
77
###################
88

9+
Versioning
10+
==========
11+
12+
Solidity versions follow `semantic versioning <https://semver.org>` and in addition to
13+
releases, **nightly development builds** are also made available. The nightly builds
14+
are not guaranteed to be working and despite best efforts they might contain undocumented
15+
and/or broken changes. We recommend to use the latest release. Package installers below
16+
will use the latest release.
17+
918
Browser-Solidity
1019
================
1120

@@ -186,3 +195,20 @@ Alternatively, you can build for Windows on the command-line, like so:
186195
.. code:: bash
187196
188197
cmake --build . --config RelWithDebInfo
198+
199+
Important information about versioning
200+
======================================
201+
202+
After a release is made, the patch version level is bumped, because we assume that only
203+
patch level changes follow. When changes are merged, the version should be bumped according
204+
to semver and the severity of the change. Finally, a release is always made with the version
205+
of the current nightly build, but without the ``prerelease`` specifier.
206+
207+
Example:
208+
- 0) the 0.4.0 release is made
209+
- 1) nightly build has a version of 0.4.1 from now on
210+
- 2) non-breaking changes are introduced - no change in version
211+
- 3) a breaking change is introduced - version is bumped to 0.5.0
212+
- 4) the 0.5.0 release is made
213+
214+
This behaviour works well with the version pragma.

libdevcore/Assertions.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ inline bool assertEqualAux(A const& _a, B const& _b, char const* _aStr, char con
7373
/// Use it as assertThrow(1 == 1, ExceptionType, "Mathematics is wrong.");
7474
/// Do NOT supply an exception object as the second parameter.
7575
#define assertThrow(_condition, _ExceptionType, _description) \
76-
::dev::assertThrowAux<_ExceptionType>(_condition, _description, __LINE__, __FILE__, ETH_FUNC)
76+
::dev::assertThrowAux<_ExceptionType>(!!(_condition), _description, __LINE__, __FILE__, ETH_FUNC)
7777

7878
using errinfo_comment = boost::error_info<struct tag_comment, std::string>;
7979

@@ -96,16 +96,4 @@ inline void assertThrowAux(
9696
);
9797
}
9898

99-
template <class _ExceptionType>
100-
inline void assertThrowAux(
101-
void const* _pointer,
102-
::std::string const& _errorDescription,
103-
unsigned _line,
104-
char const* _file,
105-
char const* _function
106-
)
107-
{
108-
assertThrowAux<_ExceptionType>(_pointer != nullptr, _errorDescription, _line, _file, _function);
109-
}
110-
11199
}

libsolidity/analysis/TypeChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ bool TypeChecker::visit(IndexAccess const& _access)
14381438
length->literalValue(nullptr)
14391439
));
14401440
else
1441-
typeError(index->location(), "Integer constant expected.");
1441+
fatalTypeError(index->location(), "Integer constant expected.");
14421442
}
14431443
break;
14441444
}

libsolidity/codegen/ContractCompiler.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ void ContractCompiler::appendFunctionSelector(ContractDefinition const& _contrac
263263
CompilerContext::LocationSetter locationSetter(m_context, functionType->declaration());
264264

265265
m_context << callDataUnpackerEntryPoints.at(it.first);
266-
if (!functionType->isPayable())
266+
// We have to allow this for libraries, because value of the previous
267+
// call is still visible in the delegatecall.
268+
if (!functionType->isPayable() && !_contract.isLibrary())
267269
{
268270
// Throw if function is not payable but call contained ether.
269271
m_context << Instruction::CALLVALUE;

libsolidity/codegen/ExpressionCompiler.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,18 @@ void ExpressionCompiler::appendExternalFunctionCall(
14761476
utils().storeFreeMemoryPointer();
14771477
}
14781478

1479+
// Touch the end of the output area so that we do not pay for memory resize during the call
1480+
// (which we would have to subtract from the gas left)
1481+
// We could also just use MLOAD; POP right before the gas calculation, but the optimizer
1482+
// would remove that, so we use MSTORE here.
1483+
if (!_functionType.gasSet() && retSize > 0)
1484+
{
1485+
m_context << u256(0);
1486+
utils().fetchFreeMemoryPointer();
1487+
// This touches too much, but that way we save some rounding arithmetics
1488+
m_context << u256(retSize) << Instruction::ADD << Instruction::MSTORE;
1489+
}
1490+
14791491
// Copy function identifier to memory.
14801492
utils().fetchFreeMemoryPointer();
14811493
if (!_functionType.isBareCall() || manualFunctionId)
@@ -1551,10 +1563,7 @@ void ExpressionCompiler::appendExternalFunctionCall(
15511563
gasNeededByCaller += eth::GasCosts::callValueTransferGas;
15521564
if (!isCallCode && !isDelegateCall && !existenceChecked)
15531565
gasNeededByCaller += eth::GasCosts::callNewAccountGas; // we never know
1554-
m_context <<
1555-
gasNeededByCaller <<
1556-
Instruction::GAS <<
1557-
Instruction::SUB;
1566+
m_context << gasNeededByCaller << Instruction::GAS << Instruction::SUB;
15581567
}
15591568
if (isDelegateCall)
15601569
m_context << Instruction::DELEGATECALL;

0 commit comments

Comments
 (0)