mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #7353 from ethereum/develop
Update 0.6.0 from develop
This commit is contained in:
@@ -9,29 +9,6 @@ contract test {
|
||||
// :test
|
||||
// [
|
||||
// {
|
||||
// "constant": false,
|
||||
// "inputs":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "uint256",
|
||||
// "name": "a",
|
||||
// "type": "uint256"
|
||||
// }
|
||||
// ],
|
||||
// "name": "f",
|
||||
// "outputs":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "uint256",
|
||||
// "name": "d",
|
||||
// "type": "uint256"
|
||||
// }
|
||||
// ],
|
||||
// "payable": false,
|
||||
// "stateMutability": "nonpayable",
|
||||
// "type": "function"
|
||||
// },
|
||||
// {
|
||||
// "anonymous": false,
|
||||
// "inputs":
|
||||
// [
|
||||
@@ -76,5 +53,28 @@ contract test {
|
||||
// "inputs": [],
|
||||
// "name": "e3",
|
||||
// "type": "event"
|
||||
// },
|
||||
// {
|
||||
// "constant": false,
|
||||
// "inputs":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "uint256",
|
||||
// "name": "a",
|
||||
// "type": "uint256"
|
||||
// }
|
||||
// ],
|
||||
// "name": "f",
|
||||
// "outputs":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "uint256",
|
||||
// "name": "d",
|
||||
// "type": "uint256"
|
||||
// }
|
||||
// ],
|
||||
// "payable": false,
|
||||
// "stateMutability": "nonpayable",
|
||||
// "type": "function"
|
||||
// }
|
||||
// ]
|
||||
|
||||
@@ -10,6 +10,20 @@ contract Derived is Base {
|
||||
// :Base
|
||||
// [
|
||||
// {
|
||||
// "anonymous": false,
|
||||
// "inputs":
|
||||
// [
|
||||
// {
|
||||
// "indexed": true,
|
||||
// "internalType": "bytes32",
|
||||
// "name": "evtArgBase",
|
||||
// "type": "bytes32"
|
||||
// }
|
||||
// ],
|
||||
// "name": "baseEvent",
|
||||
// "type": "event"
|
||||
// },
|
||||
// {
|
||||
// "constant": false,
|
||||
// "inputs":
|
||||
// [
|
||||
@@ -31,7 +45,12 @@ contract Derived is Base {
|
||||
// "payable": false,
|
||||
// "stateMutability": "nonpayable",
|
||||
// "type": "function"
|
||||
// },
|
||||
// }
|
||||
// ]
|
||||
//
|
||||
//
|
||||
// :Derived
|
||||
// [
|
||||
// {
|
||||
// "anonymous": false,
|
||||
// "inputs":
|
||||
@@ -45,12 +64,21 @@ contract Derived is Base {
|
||||
// ],
|
||||
// "name": "baseEvent",
|
||||
// "type": "event"
|
||||
// }
|
||||
// ]
|
||||
//
|
||||
//
|
||||
// :Derived
|
||||
// [
|
||||
// },
|
||||
// {
|
||||
// "anonymous": false,
|
||||
// "inputs":
|
||||
// [
|
||||
// {
|
||||
// "indexed": true,
|
||||
// "internalType": "uint256",
|
||||
// "name": "evtArgDerived",
|
||||
// "type": "uint256"
|
||||
// }
|
||||
// ],
|
||||
// "name": "derivedEvent",
|
||||
// "type": "event"
|
||||
// },
|
||||
// {
|
||||
// "constant": false,
|
||||
// "inputs":
|
||||
@@ -96,33 +124,5 @@ contract Derived is Base {
|
||||
// "payable": false,
|
||||
// "stateMutability": "nonpayable",
|
||||
// "type": "function"
|
||||
// },
|
||||
// {
|
||||
// "anonymous": false,
|
||||
// "inputs":
|
||||
// [
|
||||
// {
|
||||
// "indexed": true,
|
||||
// "internalType": "uint256",
|
||||
// "name": "evtArgDerived",
|
||||
// "type": "uint256"
|
||||
// }
|
||||
// ],
|
||||
// "name": "derivedEvent",
|
||||
// "type": "event"
|
||||
// },
|
||||
// {
|
||||
// "anonymous": false,
|
||||
// "inputs":
|
||||
// [
|
||||
// {
|
||||
// "indexed": true,
|
||||
// "internalType": "bytes32",
|
||||
// "name": "evtArgBase",
|
||||
// "type": "bytes32"
|
||||
// }
|
||||
// ],
|
||||
// "name": "baseEvent",
|
||||
// "type": "event"
|
||||
// }
|
||||
// ]
|
||||
|
||||
@@ -6,6 +6,29 @@ contract test {
|
||||
// :test
|
||||
// [
|
||||
// {
|
||||
// "constant": true,
|
||||
// "inputs":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "uint32",
|
||||
// "name": "a",
|
||||
// "type": "uint32"
|
||||
// }
|
||||
// ],
|
||||
// "name": "boo",
|
||||
// "outputs":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "uint256",
|
||||
// "name": "b",
|
||||
// "type": "uint256"
|
||||
// }
|
||||
// ],
|
||||
// "payable": false,
|
||||
// "stateMutability": "pure",
|
||||
// "type": "function"
|
||||
// },
|
||||
// {
|
||||
// "constant": false,
|
||||
// "inputs":
|
||||
// [
|
||||
@@ -32,28 +55,5 @@ contract test {
|
||||
// "payable": false,
|
||||
// "stateMutability": "nonpayable",
|
||||
// "type": "function"
|
||||
// },
|
||||
// {
|
||||
// "constant": true,
|
||||
// "inputs":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "uint32",
|
||||
// "name": "a",
|
||||
// "type": "uint32"
|
||||
// }
|
||||
// ],
|
||||
// "name": "boo",
|
||||
// "outputs":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "uint256",
|
||||
// "name": "b",
|
||||
// "type": "uint256"
|
||||
// }
|
||||
// ],
|
||||
// "payable": false,
|
||||
// "stateMutability": "pure",
|
||||
// "type": "function"
|
||||
// }
|
||||
// ]
|
||||
|
||||
@@ -11,6 +11,19 @@ contract test {
|
||||
// :test
|
||||
// [
|
||||
// {
|
||||
// "inputs":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "enum test.ActionChoices",
|
||||
// "name": "param",
|
||||
// "type": "uint8"
|
||||
// }
|
||||
// ],
|
||||
// "payable": false,
|
||||
// "stateMutability": "nonpayable",
|
||||
// "type": "constructor"
|
||||
// },
|
||||
// {
|
||||
// "constant": false,
|
||||
// "inputs": [],
|
||||
// "name": "ret",
|
||||
@@ -25,18 +38,5 @@ contract test {
|
||||
// "payable": false,
|
||||
// "stateMutability": "nonpayable",
|
||||
// "type": "function"
|
||||
// },
|
||||
// {
|
||||
// "inputs":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "enum test.ActionChoices",
|
||||
// "name": "param",
|
||||
// "type": "uint8"
|
||||
// }
|
||||
// ],
|
||||
// "payable": false,
|
||||
// "stateMutability": "nonpayable",
|
||||
// "type": "constructor"
|
||||
// }
|
||||
// ]
|
||||
|
||||
@@ -6,6 +6,29 @@ contract test {
|
||||
// :test
|
||||
// [
|
||||
// {
|
||||
// "constant": true,
|
||||
// "inputs":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "uint32",
|
||||
// "name": "a",
|
||||
// "type": "uint32"
|
||||
// }
|
||||
// ],
|
||||
// "name": "boo",
|
||||
// "outputs":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "uint256",
|
||||
// "name": "b",
|
||||
// "type": "uint256"
|
||||
// }
|
||||
// ],
|
||||
// "payable": false,
|
||||
// "stateMutability": "view",
|
||||
// "type": "function"
|
||||
// },
|
||||
// {
|
||||
// "constant": false,
|
||||
// "inputs":
|
||||
// [
|
||||
@@ -32,28 +55,5 @@ contract test {
|
||||
// "payable": false,
|
||||
// "stateMutability": "nonpayable",
|
||||
// "type": "function"
|
||||
// },
|
||||
// {
|
||||
// "constant": true,
|
||||
// "inputs":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "uint32",
|
||||
// "name": "a",
|
||||
// "type": "uint32"
|
||||
// }
|
||||
// ],
|
||||
// "name": "boo",
|
||||
// "outputs":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "uint256",
|
||||
// "name": "b",
|
||||
// "type": "uint256"
|
||||
// }
|
||||
// ],
|
||||
// "payable": false,
|
||||
// "stateMutability": "view",
|
||||
// "type": "function"
|
||||
// }
|
||||
// ]
|
||||
|
||||
@@ -212,7 +212,7 @@ BOOST_AUTO_TEST_CASE(compound_assignment_division)
|
||||
uint[] array;
|
||||
function f(uint x, uint p) public {
|
||||
require(x == 2);
|
||||
require(array[p] == 10);
|
||||
array[p] = 10;
|
||||
array[p] /= array[p] / x;
|
||||
assert(array[p] == x);
|
||||
assert(array[p] == 0);
|
||||
@@ -225,7 +225,7 @@ BOOST_AUTO_TEST_CASE(compound_assignment_division)
|
||||
mapping (uint => uint) map;
|
||||
function f(uint x, uint p) public {
|
||||
require(x == 2);
|
||||
require(map[p] == 10);
|
||||
map[p] = 10;
|
||||
map[p] /= map[p] / x;
|
||||
assert(map[p] == x);
|
||||
assert(map[p] == 0);
|
||||
|
||||
@@ -5,11 +5,11 @@ contract C
|
||||
uint[] array;
|
||||
function f(uint x, uint p) public {
|
||||
require(x < 100);
|
||||
require(array[p] == 100);
|
||||
array[p] = 100;
|
||||
array[p] += array[p] + x;
|
||||
assert(array[p] < 300);
|
||||
assert(array[p] < 110);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (202-224): Assertion violation happens here
|
||||
// Warning: (192-214): Assertion violation happens here
|
||||
|
||||
@@ -5,11 +5,11 @@ contract C
|
||||
mapping (uint => uint) map;
|
||||
function f(uint x, uint p) public {
|
||||
require(x < 100);
|
||||
require(map[p] == 100);
|
||||
map[p] = 100;
|
||||
map[p] += map[p] + x;
|
||||
assert(map[p] < 300);
|
||||
assert(map[p] < 110);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (208-228): Assertion violation happens here
|
||||
// Warning: (198-218): Assertion violation happens here
|
||||
|
||||
@@ -5,11 +5,11 @@ contract C
|
||||
uint[] array;
|
||||
function f(uint x, uint p) public {
|
||||
require(x < 10);
|
||||
require(array[p] == 10);
|
||||
array[p] = 10;
|
||||
array[p] *= array[p] + x;
|
||||
assert(array[p] <= 190);
|
||||
assert(array[p] < 50);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (201-222): Assertion violation happens here
|
||||
// Warning: (191-212): Assertion violation happens here
|
||||
|
||||
@@ -5,11 +5,11 @@ contract C
|
||||
mapping (uint => uint) map;
|
||||
function f(uint x, uint p) public {
|
||||
require(x < 10);
|
||||
require(map[p] == 10);
|
||||
map[p] = 10;
|
||||
map[p] *= map[p] + x;
|
||||
assert(map[p] <= 190);
|
||||
assert(map[p] < 50);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (207-226): Assertion violation happens here
|
||||
// Warning: (197-216): Assertion violation happens here
|
||||
|
||||
@@ -5,11 +5,11 @@ contract C
|
||||
uint[] array;
|
||||
function f(uint x, uint p) public {
|
||||
require(x < 100);
|
||||
require(array[p] == 200);
|
||||
array[p] = 200;
|
||||
array[p] -= array[p] - x;
|
||||
assert(array[p] >= 0);
|
||||
assert(array[p] < 90);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (201-222): Assertion violation happens here
|
||||
// Warning: (191-212): Assertion violation happens here
|
||||
|
||||
@@ -5,11 +5,11 @@ contract C
|
||||
mapping (uint => uint) map;
|
||||
function f(uint x, uint p) public {
|
||||
require(x < 100);
|
||||
require(map[p] == 200);
|
||||
map[p] = 200;
|
||||
map[p] -= map[p] - x;
|
||||
assert(map[p] >= 0);
|
||||
assert(map[p] < 90);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (207-226): Assertion violation happens here
|
||||
// Warning: (197-216): Assertion violation happens here
|
||||
|
||||
@@ -10,12 +10,9 @@ contract C
|
||||
delete a;
|
||||
else
|
||||
delete a[2];
|
||||
// Assertion fails as false positive because
|
||||
// setZeroValue for arrays needs \forall i . a[i] = 0
|
||||
// which is still unimplemented.
|
||||
assert(a[2] == 0);
|
||||
assert(a[1] == 0);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (118-119): Condition is always true.
|
||||
// Warning: (297-314): Assertion violation happens here
|
||||
|
||||
@@ -6,10 +6,6 @@ contract C
|
||||
function f() public {
|
||||
require(a[2][3] == 4);
|
||||
delete a;
|
||||
// Fails as false positive.
|
||||
// setZeroValue needs forall for arrays.
|
||||
assert(a[2][3] == 0);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (194-214): Assertion violation happens here
|
||||
|
||||
@@ -9,11 +9,7 @@ contract C
|
||||
delete a;
|
||||
else
|
||||
delete a[2];
|
||||
// Fails as false positive since
|
||||
// setZeroValue for arrays needs forall
|
||||
// which is unimplemented.
|
||||
assert(a[2][3] == 0);
|
||||
assert(a[1][1] == 0);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (266-286): Assertion violation happens here
|
||||
|
||||
@@ -16,12 +16,9 @@ contract C
|
||||
g();
|
||||
else
|
||||
h();
|
||||
// Assertion fails as false positive because
|
||||
// setZeroValue for arrays needs \forall i . a[i] = 0
|
||||
// which is still unimplemented.
|
||||
assert(a[2] == 0);
|
||||
assert(a[1] == 0);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (201-202): Condition is always true.
|
||||
// Warning: (367-384): Assertion violation happens here
|
||||
|
||||
@@ -4,10 +4,11 @@ contract C
|
||||
{
|
||||
uint[][] array;
|
||||
function f(uint x, uint y, uint z, uint t) public view {
|
||||
require(array[x][y] == 200);
|
||||
// TODO change to = 200 when 2d assignments are supported.
|
||||
require(array[x][y] < 200);
|
||||
require(x == z && y == t);
|
||||
assert(array[z][t] > 300);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (183-208): Assertion violation happens here
|
||||
// Warning: (243-268): Assertion violation happens here
|
||||
|
||||
@@ -4,10 +4,11 @@ contract C
|
||||
{
|
||||
uint[][][] array;
|
||||
function f(uint x, uint y, uint z, uint t, uint w, uint v) public view {
|
||||
require(array[x][y][z] == 200);
|
||||
// TODO change to = 200 when 3d assignments are supported.
|
||||
require(array[x][y][z] < 200);
|
||||
require(x == t && y == w && z == v);
|
||||
assert(array[t][w][v] > 300);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (214-242): Assertion violation happens here
|
||||
// Warning: (274-302): Assertion violation happens here
|
||||
|
||||
@@ -4,10 +4,10 @@ contract C
|
||||
{
|
||||
uint[10][20] array;
|
||||
function f(uint x, uint y, uint z, uint t) public view {
|
||||
require(array[x][y] == 200);
|
||||
require(array[x][y] < 200);
|
||||
require(x == z && y == t);
|
||||
assert(array[z][t] > 300);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (187-212): Assertion violation happens here
|
||||
// Warning: (186-211): Assertion violation happens here
|
||||
|
||||
@@ -4,10 +4,11 @@ contract C
|
||||
{
|
||||
uint[10][20][30] array;
|
||||
function f(uint x, uint y, uint z, uint t, uint w, uint v) public view {
|
||||
require(array[x][y][z] == 200);
|
||||
// TODO change to = 200 when 3d assignments are supported.
|
||||
require(array[x][y][z] < 200);
|
||||
require(x == t && y == w && z == v);
|
||||
assert(array[t][w][v] > 300);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (220-248): Assertion violation happens here
|
||||
// Warning: (280-308): Assertion violation happens here
|
||||
|
||||
@@ -9,4 +9,3 @@ contract C
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (125-144): Assertion violation happens here
|
||||
|
||||
Reference in New Issue
Block a user