Merge branch 'develop' into develop_060

This commit is contained in:
Daniel Kirchner 2019-11-12 10:32:41 +01:00
commit 8148619d5b
18 changed files with 35 additions and 55 deletions

View File

@ -431,12 +431,12 @@ jobs:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- dependencies-osx-{{ .Branch }}-{{ checksum ".circleci/config.yml" }} - dependencies-osx-{{ .Branch }}-{{ checksum ".circleci/config.yml" }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
- run: - run:
name: Install build dependencies name: Install build dependencies
command: ./.circleci/osx_install_dependencies.sh command: ./.circleci/osx_install_dependencies.sh
- save_cache: - save_cache:
key: dependencies-osx-{{ .Branch }}-{{ checksum ".circleci/config.yml" }} key: dependencies-osx-{{ .Branch }}-{{ checksum ".circleci/config.yml" }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
paths: paths:
- /usr/local/bin - /usr/local/bin
- /usr/local/sbin - /usr/local/sbin
@ -459,7 +459,7 @@ jobs:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- dependencies-osx-{{ .Branch }}-{{ checksum ".circleci/config.yml" }} - dependencies-osx-{{ .Branch }}-{{ checksum ".circleci/config.yml" }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
- attach_workspace: - attach_workspace:
at: build at: build
- run: *run_soltest - run: *run_soltest
@ -475,7 +475,7 @@ jobs:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- dependencies-osx-{{ .Branch }}-{{ checksum ".circleci/config.yml" }} - dependencies-osx-{{ .Branch }}-{{ checksum ".circleci/config.yml" }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
- attach_workspace: - attach_workspace:
at: build at: build
- run: *run_cmdline_tests - run: *run_cmdline_tests

View File

@ -62,7 +62,7 @@ RUN git clone --recursive -b boost-1.69.0 https://github.com/boostorg/boost.git
rm -rf /usr/src/boost rm -rf /usr/src/boost
# Z3 # Z3
RUN git clone --depth 1 -b Z3-4.8.5 https://github.com/Z3Prover/z3.git \ RUN git clone --depth 1 -b z3-4.8.6 https://github.com/Z3Prover/z3.git \
/usr/src/z3; \ /usr/src/z3; \
cd /usr/src/z3; \ cd /usr/src/z3; \
python scripts/mk_make.py --prefix=/usr ; \ python scripts/mk_make.py --prefix=/usr ; \

View File

@ -43,13 +43,13 @@ then
./scripts/install_obsolete_jsoncpp_1_7_4.sh ./scripts/install_obsolete_jsoncpp_1_7_4.sh
# z3 # z3
wget https://github.com/Z3Prover/z3/releases/download/Z3-4.8.5/z3-4.8.5-x64-osx-10.14.2.zip wget https://github.com/Z3Prover/z3/releases/download/z3-4.8.6/z3-4.8.6-x64-osx-10.14.6.zip
unzip z3-4.8.5-x64-osx-10.14.2.zip unzip z3-4.8.6-x64-osx-10.14.6.zip
rm -f z3-4.8.5-x64-osx-10.14.2.zip rm -f z3-4.8.6-x64-osx-10.14.6.zip
cp z3-4.8.5-x64-osx-10.14.2/bin/libz3.a /usr/local/lib cp z3-4.8.6-x64-osx-10.14.6/bin/libz3.a /usr/local/lib
cp z3-4.8.5-x64-osx-10.14.2/bin/z3 /usr/local/bin cp z3-4.8.6-x64-osx-10.14.6/bin/z3 /usr/local/bin
cp z3-4.8.5-x64-osx-10.14.2/include/* /usr/local/include cp z3-4.8.6-x64-osx-10.14.6/include/* /usr/local/include
rm -rf z3-4.8.5-x64-osx-10.14.2 rm -rf z3-4.8.6-x64-osx-10.14.6
# evmone # evmone
wget https://github.com/ethereum/evmone/releases/download/v0.1.0/evmone-0.1.0-darwin-x86_64.tar.gz wget https://github.com/ethereum/evmone/releases/download/v0.1.0/evmone-0.1.0-darwin-x86_64.tar.gz

View File

@ -29,7 +29,7 @@ using namespace langutil;
Error::Error(Type _type, SourceLocation const& _location, string const& _description): Error::Error(Type _type, SourceLocation const& _location, string const& _description):
m_type(_type) m_type(_type)
{ {
switch(m_type) switch (m_type)
{ {
case Type::DeclarationError: case Type::DeclarationError:
m_typeName = "DeclarationError"; m_typeName = "DeclarationError";

View File

@ -49,7 +49,7 @@ bool ControlFlowBuilder::visit(BinaryOperation const& _operation)
{ {
solAssert(!!m_currentNode, ""); solAssert(!!m_currentNode, "");
switch(_operation.getOperator()) switch (_operation.getOperator())
{ {
case Token::Or: case Token::Or:
case Token::And: case Token::And:

View File

@ -126,7 +126,7 @@ bool ReferencesResolver::visit(ElementaryTypeName const& _typeName)
{ {
// for non-address types this was already caught by the parser // for non-address types this was already caught by the parser
solAssert(_typeName.annotation().type->category() == Type::Category::Address, ""); solAssert(_typeName.annotation().type->category() == Type::Category::Address, "");
switch(*_typeName.stateMutability()) switch (*_typeName.stateMutability())
{ {
case StateMutability::Payable: case StateMutability::Payable:
_typeName.annotation().type = TypeProvider::payableAddress(); _typeName.annotation().type = TypeProvider::payableAddress();

View File

@ -229,7 +229,7 @@ bool StaticAnalyzer::visit(MemberAccess const& _memberAccess)
if (m_constructor) if (m_constructor)
{ {
auto const* expr = &_memberAccess.expression(); auto const* expr = &_memberAccess.expression();
while(expr) while (expr)
{ {
if (auto id = dynamic_cast<Identifier const*>(expr)) if (auto id = dynamic_cast<Identifier const*>(expr))
{ {

View File

@ -187,7 +187,7 @@ public:
static std::string visibilityToString(Declaration::Visibility _visibility) static std::string visibilityToString(Declaration::Visibility _visibility)
{ {
switch(_visibility) switch (_visibility)
{ {
case Declaration::Visibility::Public: case Declaration::Visibility::Public:
return "public"; return "public";

View File

@ -36,7 +36,7 @@ enum class StateMutability { Pure, View, NonPayable, Payable };
inline std::string stateMutabilityToString(StateMutability const& _stateMutability) inline std::string stateMutabilityToString(StateMutability const& _stateMutability)
{ {
switch(_stateMutability) switch (_stateMutability)
{ {
case StateMutability::Pure: case StateMutability::Pure:
return "pure"; return "pure";

View File

@ -663,7 +663,7 @@ BoolResult FixedPointType::isExplicitlyConvertibleTo(Type const& _convertTo) con
TypeResult FixedPointType::unaryOperatorResult(Token _operator) const TypeResult FixedPointType::unaryOperatorResult(Token _operator) const
{ {
switch(_operator) switch (_operator)
{ {
case Token::Delete: case Token::Delete:
// "delete" is ok for all fixed types // "delete" is ok for all fixed types
@ -2881,7 +2881,7 @@ unsigned FunctionType::sizeOnStack() const
unsigned size = 0; unsigned size = 0;
switch(kind) switch (kind)
{ {
case Kind::External: case Kind::External:
case Kind::DelegateCall: case Kind::DelegateCall:

View File

@ -254,7 +254,7 @@ std::pair<ContractDefinition::ContractKind, bool> Parser::parseContractKind()
abstract = true; abstract = true;
m_scanner->next(); m_scanner->next();
} }
switch(m_scanner->currentToken()) switch (m_scanner->currentToken())
{ {
case Token::Interface: case Token::Interface:
kind = ContractDefinition::ContractKind::Interface; kind = ContractDefinition::ContractKind::Interface;
@ -436,7 +436,7 @@ StateMutability Parser::parseStateMutability()
{ {
StateMutability stateMutability(StateMutability::NonPayable); StateMutability stateMutability(StateMutability::NonPayable);
Token token = m_scanner->currentToken(); Token token = m_scanner->currentToken();
switch(token) switch (token)
{ {
case Token::Payable: case Token::Payable:
stateMutability = StateMutability::Payable; stateMutability = StateMutability::Payable;

View File

@ -113,7 +113,7 @@ u256 yul::valueOfBoolLiteral(Literal const& _literal)
u256 yul::valueOfLiteral(Literal const& _literal) u256 yul::valueOfLiteral(Literal const& _literal)
{ {
switch(_literal.kind) switch (_literal.kind)
{ {
case LiteralKind::Number: case LiteralKind::Number:
return valueOfNumberLiteral(_literal); return valueOfNumberLiteral(_literal);

View File

@ -17,7 +17,7 @@ fi
FORMATERROR=$( FORMATERROR=$(
( (
git grep -nIE "\<(if|for)\(" -- '*.h' '*.cpp' # no space after "if" or "for" git grep -nIE "\<(if|for|while|switch)\(" -- '*.h' '*.cpp' # no space after "if", "for", "while" or "switch"
git grep -nIE "\<for\>\s*\([^=]*\>\s:\s.*\)" -- '*.h' '*.cpp' # no space before range based for-loop git grep -nIE "\<for\>\s*\([^=]*\>\s:\s.*\)" -- '*.h' '*.cpp' # no space before range based for-loop
git grep -nIE "\<if\>\s*\(.*\)\s*\{\s*$" -- '*.h' '*.cpp' # "{\n" on same line as "if" / "for" git grep -nIE "\<if\>\s*\(.*\)\s*\{\s*$" -- '*.h' '*.cpp' # "{\n" on same line as "if" / "for"
git grep -nIE "[,\(<]\s*const " -- '*.h' '*.cpp' # const on left side of type git grep -nIE "[,\(<]\s*const " -- '*.h' '*.cpp' # const on left side of type

View File

@ -25,9 +25,9 @@ set -ev
keyid=70D110489D66E2F6 keyid=70D110489D66E2F6
email=builds@ethereum.org email=builds@ethereum.org
packagename=libz3-static-dev packagename=libz3-static-dev
version=4.8.5 version=4.8.6
DISTRIBUTIONS="bionic disco" DISTRIBUTIONS="bionic disco eoan"
for distribution in $DISTRIBUTIONS for distribution in $DISTRIBUTIONS
do do
@ -40,7 +40,7 @@ pparepo=cpp-build-deps
ppafilesurl=https://launchpad.net/~ethereum/+archive/ubuntu/${pparepo}/+files ppafilesurl=https://launchpad.net/~ethereum/+archive/ubuntu/${pparepo}/+files
# Fetch source # Fetch source
git clone --depth 1 --branch Z3-${version} https://github.com/Z3Prover/z3.git git clone --depth 1 --branch z3-${version} https://github.com/Z3Prover/z3.git
cd z3 cd z3
debversion="$version" debversion="$version"

View File

@ -57,7 +57,7 @@ packagename=solc
static_build_distribution=disco static_build_distribution=disco
DISTRIBUTIONS="bionic disco" DISTRIBUTIONS="bionic disco eoan"
if is_release if is_release
then then

View File

@ -7,10 +7,11 @@ contract Simple {
for (i = 0; i < n; ++i) for (i = 0; i < n; ++i)
a[i] = i; a[i] = i;
require(n > 1); require(n > 1);
// Assertion is safe but current solver version cannot solve it. // Assertion is safe but current solver version times out.
// Keep test for next solver release. // Keep test for next solver release.
assert(a[n-1] > a[n-2]); assert(a[n-1] > a[n-2]);
} }
} }
// ---- // ----
// Warning: (267-290): Assertion violation happens here // Warning: (261-284): Error trying to invoke SMT solver.
// Warning: (261-284): Assertion violation happens here

View File

@ -1,23 +0,0 @@
pragma experimental SMTChecker;
contract LoopFor2 {
uint[] b;
uint[] c;
function testUnboundedForLoop(uint n) public {
b[0] = 900;
uint[] memory a = b;
require(n > 0 && n < 100);
uint i;
while (i < n) {
b[i] = i + 1;
c[i] = b[i];
++i;
}
assert(b[0] == c[0]);
assert(a[0] == 900);
assert(b[0] == 900);
}
}
// ----
// Warning: (312-331): Assertion violation happens here

View File

@ -14,11 +14,13 @@ contract LoopFor2 {
c[i] = b[i]; c[i] = b[i];
++i; ++i;
} }
// Fails as false positive.
assert(b[0] == c[0]); assert(b[0] == c[0]);
assert(a[0] == 900); assert(a[0] == 900);
assert(b[0] == 900); assert(b[0] == 900);
} }
} }
// ---- // ----
// Warning: (290-309): Assertion violation happens here // Warning: (296-316): Assertion violation happens here
// Warning: (313-332): Assertion violation happens here // Warning: (320-339): Assertion violation happens here
// Warning: (343-362): Assertion violation happens here