Update tests.

This commit is contained in:
chriseth
2020-10-22 19:25:55 +02:00
parent bfd267459c
commit 60af9d24ff
94 changed files with 521 additions and 339 deletions
+15 -7
View File
@@ -103,7 +103,7 @@ object "C_80" {
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
@@ -116,7 +116,7 @@ object "C_80" {
function checked_exp_t_rational_10_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
if gt(exponent, 77) { panic_error() }
if gt(exponent, 77) { panic_error_0x11() }
power := exp(10, exponent)
}
@@ -124,7 +124,7 @@ object "C_80" {
function checked_exp_t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
if gt(exponent, 1) { panic_error() }
if gt(exponent, 1) { panic_error_0x11() }
power := exp(115792089237316195423570985008687907853269984665640564039457584007913129639935, exponent)
}
@@ -138,7 +138,7 @@ object "C_80" {
function checked_exp_t_rational_2_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
if gt(exponent, 255) { panic_error() }
if gt(exponent, 255) { panic_error_0x11() }
power := exp(2, exponent)
}
@@ -152,7 +152,7 @@ object "C_80" {
function checked_exp_t_rational_minus_2_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
if gt(exponent, 255) { panic_error() }
if gt(exponent, 255) { panic_error_0x11() }
power := exp(115792089237316195423570985008687907853269984665640564039457584007913129639934, exponent)
}
@@ -274,8 +274,16 @@ object "C_80" {
}
function panic_error() {
invalid()
function panic_error_0x11() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x11)
revert(0, 0x24)
}
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function shift_right_224_unsigned(value) -> newValue {
@@ -57,7 +57,7 @@ object "D_15" {
if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) }
let _2 := datasize("C_2")
let _3 := add(128, _2)
if or(gt(_3, 0xffffffffffffffff), lt(_3, 128)) { invalid() }
if or(gt(_3, 0xffffffffffffffff), lt(_3, 128)) { panic_error_0x41() }
datacopy(128, dataoffset("C_2"), _2)
pop(create(_1, 128, _2))
return(allocateMemory(_1), _1)
@@ -69,9 +69,15 @@ object "D_15" {
{
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { invalid() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
function panic_error_0x41()
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x41)
revert(0, 0x24)
}
}
object "C_2" {
code {
+28 -17
View File
@@ -33,7 +33,7 @@ object "C_59" {
if gt(offset, _3) { revert(_1, _1) }
if iszero(slt(add(offset, 35), calldatasize())) { revert(_1, _1) }
let length := calldataload(add(4, offset))
if gt(length, _3) { invalid() }
if gt(length, _3) { panic_error_0x41() }
let _4 := mul(length, _2)
let dst := allocateMemory(add(_4, _2))
let dst_1 := dst
@@ -60,7 +60,7 @@ object "C_59" {
if slt(sub(end, headStart), 0x20) { revert(value, value) }
let memPtr := mload(64)
let newFreePtr := add(memPtr, 0x20)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { invalid() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
value := memPtr
mstore(memPtr, calldataload(headStart))
@@ -87,14 +87,14 @@ object "C_59" {
{
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { invalid() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
function convert_t_stringliteral_6490_to_t_string() -> converted
{
let memPtr := mload(64)
let newFreePtr := add(memPtr, 160)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { invalid() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
converted := memPtr
mstore(memPtr, 100)
@@ -109,26 +109,37 @@ object "C_59" {
}
function fun_sumArray_58(vloc__s_22_mpos) -> vloc, vloc__27_mpos
{
let _1 := mload(vloc__s_22_mpos)
if iszero(lt(vloc, _1)) { invalid() }
let _2 := mload(mload(add(add(vloc__s_22_mpos, mul(vloc, 32)), 32)))
let _3, _4 := storage_array_index_access$_t_struct$_S_storage(vloc, vloc)
sstore(_3, _2)
if iszero(lt(0x01, _1)) { invalid() }
let _5 := mload(mload(add(vloc__s_22_mpos, 64)))
if iszero(lt(vloc, 0x02)) { invalid() }
if iszero(lt(vloc, mload(vloc__s_22_mpos))) { panic_error_0x32() }
let _1 := mload(mload(add(add(vloc__s_22_mpos, mul(vloc, 32)), 32)))
let _2, _3 := storage_array_index_access$_t_struct$_S_storage(vloc, vloc)
sstore(_2, _1)
if iszero(lt(0x01, mload(vloc__s_22_mpos))) { panic_error_0x32() }
let _4 := mload(mload(add(vloc__s_22_mpos, 64)))
if iszero(lt(vloc, 0x02)) { panic_error_0x32() }
let slot := add(0x02, vloc)
let _6 := sload(slot)
let _5 := sload(slot)
let shiftBits := mul(vloc, 8)
let mask := shl(shiftBits, not(0))
sstore(slot, or(and(_6, not(mask)), and(shl(shiftBits, _5), mask)))
let _7, _8 := storage_array_index_access$_t_struct$_S_storage(0x02, vloc)
vloc := extract_from_storage_value_dynamict_uint256(sload(_7), _8)
sstore(slot, or(and(_5, not(mask)), and(shl(shiftBits, _4), mask)))
let _6, _7 := storage_array_index_access$_t_struct$_S_storage(0x02, vloc)
vloc := extract_from_storage_value_dynamict_uint256(sload(_6), _7)
vloc__27_mpos := convert_t_stringliteral_6490_to_t_string()
}
function panic_error_0x32()
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x32)
revert(0, 0x24)
}
function panic_error_0x41()
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x41)
revert(0, 0x24)
}
function storage_array_index_access$_t_struct$_S_storage(array, index) -> slot, offset
{
if iszero(lt(index, 0x02)) { invalid() }
if iszero(lt(index, 0x02)) { panic_error_0x32() }
slot := add(array, index)
offset := offset
}
+19 -5
View File
@@ -33,14 +33,12 @@ object "Arraysum_33" {
for { }
lt(vloc_i, _2)
{
if eq(vloc_i, not(0)) { invalid() }
if eq(vloc_i, not(0)) { panic_error_0x11() }
vloc_i := add(vloc_i, 1)
}
{
mstore(_1, _1)
let _3 := sload(add(keccak256(_1, 0x20), vloc_i))
if gt(vloc_sum, not(_3)) { invalid() }
vloc_sum := add(vloc_sum, _3)
vloc_sum := checked_add_t_uint256(vloc_sum, sload(add(keccak256(_1, 0x20), vloc_i)))
}
let memPos := allocateMemory(_1)
return(memPos, sub(abi_encode_uint(memPos, vloc_sum), memPos))
@@ -57,9 +55,25 @@ object "Arraysum_33" {
{
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { invalid() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr))
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x41)
revert(0, 0x24)
}
mstore(64, newFreePtr)
}
function checked_add_t_uint256(x, y) -> sum
{
if gt(x, not(y)) { panic_error_0x11() }
sum := add(x, y)
}
function panic_error_0x11()
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x11)
revert(0, 0x24)
}
}
}
}
File diff suppressed because one or more lines are too long
@@ -44,13 +44,17 @@ object \"C_6\" {
{
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
function fun_f_5()
{ }
function panic_error()
{ invalid() }
function panic_error_0x41()
{
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function shift_right_224_unsigned(value) -> newValue
{ newValue := shr(224, value) }
}
@@ -61,7 +61,7 @@ object \"C_6\" {
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
@@ -69,8 +69,10 @@ object \"C_6\" {
}
function panic_error() {
invalid()
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function shift_right_224_unsigned(value) -> newValue {
File diff suppressed because one or more lines are too long
@@ -71,7 +71,7 @@ object \"C_10\" {
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
@@ -116,8 +116,10 @@ object \"C_10\" {
}
function panic_error() {
invalid()
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function round_up_to_mul_of_32(value) -> result {
@@ -67,7 +67,7 @@ object \"C_10\" {
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
@@ -88,8 +88,10 @@ object \"C_10\" {
}
function panic_error() {
invalid()
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function shift_right_224_unsigned(value) -> newValue {
@@ -67,7 +67,7 @@ object \"C_10\" {
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
@@ -93,8 +93,10 @@ object \"C_10\" {
}
function panic_error() {
invalid()
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function shift_left_224(value) -> newValue {
@@ -71,7 +71,7 @@ object \"C_10\" {
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
@@ -120,8 +120,10 @@ object \"C_10\" {
}
function panic_error() {
invalid()
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function round_up_to_mul_of_32(value) -> result {
@@ -67,7 +67,7 @@ object \"C_10\" {
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
@@ -93,8 +93,10 @@ object \"C_10\" {
}
function panic_error() {
invalid()
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function shift_left_224(value) -> newValue {