mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #7650 from ethereum/develop
Merge develop into develop_060
This commit is contained in:
@@ -1,63 +1,5 @@
|
||||
{"contracts":{"A":{"C":{"ewasm":{"wast":"(module
|
||||
(import \"ethereum\" \"revert\" (func $eth.revert (param i32 i32)))
|
||||
(memory $memory (export \"memory\") 1)
|
||||
(export \"main\" (func $main))
|
||||
|
||||
(func $main
|
||||
(local $_1 i64)
|
||||
(local $_2 i64)
|
||||
(local $_3 i64)
|
||||
(local $hi i64)
|
||||
(local $y i64)
|
||||
(local $hi_1 i64)
|
||||
(local.set $_1 (i64.const 0))
|
||||
(local.set $_2 (i64.add (call $u256_to_i32 (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 64)) (i64.const 64)))
|
||||
(local.set $_3 (i64.const 65280))
|
||||
(local.set $hi (i64.shl (i64.or (i64.shl (i64.or (i64.and (i64.shl (local.get $_1) (i64.const 8)) (local.get $_3)) (i64.and (i64.shr_u (local.get $_1) (i64.const 8)) (i64.const 255))) (i64.const 16)) (call $endian_swap_16 (i64.shr_u (local.get $_1) (i64.const 16)))) (i64.const 32)))
|
||||
(local.set $y (i64.or (local.get $hi) (call $endian_swap_32 (i64.shr_u (local.get $_1) (i64.const 32)))))
|
||||
(i64.store (i32.wrap_i64 (local.get $_2)) (local.get $y))
|
||||
(i64.store (i32.wrap_i64 (i64.add (local.get $_2) (i64.const 8))) (local.get $y))
|
||||
(i64.store (i32.wrap_i64 (i64.add (local.get $_2) (i64.const 16))) (local.get $y))
|
||||
(local.set $hi_1 (i64.shl (i64.or (i64.shl (i64.or (i64.and (i64.shl (i64.const 128) (i64.const 8)) (local.get $_3)) (i64.and (i64.shr_u (i64.const 128) (i64.const 8)) (i64.const 255))) (i64.const 16)) (call $endian_swap_16 (i64.shr_u (i64.const 128) (i64.const 16)))) (i64.const 32)))
|
||||
(i64.store (i32.wrap_i64 (i64.add (local.get $_2) (i64.const 24))) (i64.or (local.get $hi_1) (call $endian_swap_32 (i64.shr_u (i64.const 128) (i64.const 32)))))
|
||||
(call $eth.revert (i32.wrap_i64 (i64.add (call $u256_to_i32 (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1)) (i64.const 64))) (i32.wrap_i64 (call $u256_to_i32 (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1))))
|
||||
)
|
||||
|
||||
(func $u256_to_i32
|
||||
(param $x1 i64)
|
||||
(param $x2 i64)
|
||||
(param $x3 i64)
|
||||
(param $x4 i64)
|
||||
(result i64)
|
||||
(local $v i64)
|
||||
(if (i64.ne (i64.extend_i32_u (i64.ne (local.get $v) (i64.or (i64.or (local.get $x1) (local.get $x2)) (local.get $x3)))) (i64.const 0)) (then
|
||||
(unreachable)))
|
||||
(if (i64.ne (i64.extend_i32_u (i64.ne (local.get $v) (i64.shr_u (local.get $x4) (i64.const 32)))) (i64.const 0)) (then
|
||||
(unreachable)))
|
||||
(local.set $v (local.get $x4))
|
||||
(local.get $v)
|
||||
)
|
||||
|
||||
(func $endian_swap_16
|
||||
(param $x i64)
|
||||
(result i64)
|
||||
(local $y i64)
|
||||
(local.set $y (i64.or (i64.and (i64.shl (local.get $x) (i64.const 8)) (i64.const 65280)) (i64.and (i64.shr_u (local.get $x) (i64.const 8)) (i64.const 255))))
|
||||
(local.get $y)
|
||||
)
|
||||
|
||||
(func $endian_swap_32
|
||||
(param $x i64)
|
||||
(result i64)
|
||||
(local $y i64)
|
||||
(local $hi i64)
|
||||
(local.set $hi (i64.shl (call $endian_swap_16 (local.get $x)) (i64.const 16)))
|
||||
(local.set $y (i64.or (local.get $hi) (call $endian_swap_16 (i64.shr_u (local.get $x) (i64.const 16)))))
|
||||
(local.get $y)
|
||||
)
|
||||
|
||||
)
|
||||
(module
|
||||
;; sub-module \"C_2_deployed\" will be encoded as custom section in binary here, but is skipped in text mode.
|
||||
(import \"ethereum\" \"codeCopy\" (func $eth.codeCopy (param i32 i32 i32)))
|
||||
(import \"ethereum\" \"finish\" (func $eth.finish (param i32 i32)))
|
||||
(memory $memory (export \"memory\") 1)
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
// 2 warnings, A.f and A.g
|
||||
contract A {
|
||||
uint x;
|
||||
|
||||
function f() public view {
|
||||
assert(x == 1);
|
||||
}
|
||||
function g() public view {
|
||||
assert(x == 1);
|
||||
}
|
||||
}
|
||||
|
||||
// 2 warnings, B.f and A.g
|
||||
contract B is A {
|
||||
function f() public view {
|
||||
assert(x == 0);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (113-127): Assertion violation happens here
|
||||
// Warning: (162-176): Assertion violation happens here
|
||||
// Warning: (259-273): Assertion violation happens here
|
||||
// Warning: (162-176): Assertion violation happens here
|
||||
@@ -0,0 +1,27 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
// 2 warnings, A.f and A.g
|
||||
contract A {
|
||||
uint x;
|
||||
|
||||
function f() public view {
|
||||
assert(x == 1);
|
||||
}
|
||||
function g() public view {
|
||||
assert(x == 1);
|
||||
}
|
||||
}
|
||||
|
||||
// 2 warnings, B.f and A.g
|
||||
contract B is A {
|
||||
uint y;
|
||||
|
||||
function f() public view {
|
||||
assert(x == 0);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (113-127): Assertion violation happens here
|
||||
// Warning: (162-176): Assertion violation happens here
|
||||
// Warning: (269-283): Assertion violation happens here
|
||||
// Warning: (162-176): Assertion violation happens here
|
||||
@@ -0,0 +1,47 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
// 2 warnings, A.f and A.g
|
||||
contract A {
|
||||
uint x;
|
||||
|
||||
function f() public view {
|
||||
assert(x == 1);
|
||||
}
|
||||
function g() public view {
|
||||
assert(x == 1);
|
||||
}
|
||||
}
|
||||
|
||||
// 3 warnings, B.f, B.h, A.g
|
||||
contract B is A {
|
||||
uint y;
|
||||
|
||||
function f() public view {
|
||||
assert(x == 0);
|
||||
}
|
||||
function h() public view {
|
||||
assert(x == 2);
|
||||
}
|
||||
}
|
||||
|
||||
// 4 warnings, C.f, C.i, B.h, A.g
|
||||
contract C is B {
|
||||
uint z;
|
||||
|
||||
function f() public view {
|
||||
assert(x == 0);
|
||||
}
|
||||
function i() public view {
|
||||
assert(x == 0);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (113-127): Assertion violation happens here
|
||||
// Warning: (162-176): Assertion violation happens here
|
||||
// Warning: (271-285): Assertion violation happens here
|
||||
// Warning: (320-334): Assertion violation happens here
|
||||
// Warning: (162-176): Assertion violation happens here
|
||||
// Warning: (434-448): Assertion violation happens here
|
||||
// Warning: (483-497): Assertion violation happens here
|
||||
// Warning: (320-334): Assertion violation happens here
|
||||
// Warning: (162-176): Assertion violation happens here
|
||||
Reference in New Issue
Block a user