Add cmdlineTests/asm_json_export_yul_subobjects.

This commit is contained in:
Alexander Arlt 2023-05-08 08:44:59 -05:00
parent ac7fcd6f7c
commit 72b4629118
8 changed files with 879 additions and 7 deletions

View File

@ -0,0 +1 @@
--strict-assembly - --asm-json --pretty-json

View File

@ -0,0 +1,415 @@
======= <stdin> (EVM) =======
{
".code":
[
{
"begin": 36,
"end": 51,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 33,
"end": 34,
"name": "DUP1",
"source": 0
},
{
"begin": 26,
"end": 52,
"name": "SSTORE",
"source": 0
},
{
"begin": 67,
"end": 80,
"name": "PUSHSIZE",
"source": 0
},
{
"begin": 64,
"end": 65,
"name": "PUSH",
"source": 0,
"value": "1"
},
{
"begin": 57,
"end": 81,
"name": "SSTORE",
"source": 0
},
{
"begin": 96,
"end": 111,
"name": "PUSH [$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 93,
"end": 94,
"name": "PUSH",
"source": 0,
"value": "2"
},
{
"begin": 86,
"end": 112,
"name": "SSTORE",
"source": 0
},
{
"begin": 127,
"end": 140,
"name": "PUSH #[$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 124,
"end": 125,
"name": "PUSH",
"source": 0,
"value": "3"
},
{
"begin": 117,
"end": 141,
"name": "SSTORE",
"source": 0
},
{
"begin": 156,
"end": 173,
"name": "PUSH [$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000ffffffffffffffff"
},
{
"begin": 153,
"end": 154,
"name": "PUSH",
"source": 0,
"value": "4"
},
{
"begin": 146,
"end": 174,
"name": "SSTORE",
"source": 0
},
{
"begin": 189,
"end": 204,
"name": "PUSH #[$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000ffffffffffffffff"
},
{
"begin": 186,
"end": 187,
"name": "PUSH",
"source": 0,
"value": "5"
},
{
"begin": 179,
"end": 205,
"name": "SSTORE",
"source": 0
},
{
"begin": 220,
"end": 237,
"name": "PUSH [$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000fffffffffffffffe"
},
{
"begin": 217,
"end": 218,
"name": "PUSH",
"source": 0,
"value": "6"
},
{
"begin": 210,
"end": 238,
"name": "SSTORE",
"source": 0
},
{
"begin": 253,
"end": 268,
"name": "PUSH #[$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000fffffffffffffffe"
},
{
"begin": 250,
"end": 251,
"name": "PUSH",
"source": 0,
"value": "7"
},
{
"begin": 243,
"end": 269,
"name": "SSTORE",
"source": 0
},
{
"begin": 284,
"end": 303,
"name": "PUSH [$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000fffffffffffffffd"
},
{
"begin": 281,
"end": 282,
"name": "PUSH",
"source": 0,
"value": "8"
},
{
"begin": 274,
"end": 304,
"name": "SSTORE",
"source": 0
},
{
"begin": 319,
"end": 336,
"name": "PUSH #[$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000fffffffffffffffd"
},
{
"begin": 316,
"end": 317,
"name": "PUSH",
"source": 0,
"value": "9"
},
{
"begin": 309,
"end": 337,
"name": "SSTORE",
"source": 0
}
],
".data":
{
"0":
{
".code":
[
{
"begin": 418,
"end": 433,
"name": "PUSH [$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 414,
"end": 416,
"name": "PUSH",
"source": 0,
"value": "A"
},
{
"begin": 407,
"end": 434,
"name": "SSTORE",
"source": 0
},
{
"begin": 452,
"end": 465,
"name": "PUSH #[$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 448,
"end": 450,
"name": "PUSH",
"source": 0,
"value": "B"
},
{
"begin": 441,
"end": 466,
"name": "SSTORE",
"source": 0
},
{
"begin": 484,
"end": 499,
"name": "PUSH [$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000001"
},
{
"begin": 480,
"end": 482,
"name": "PUSH",
"source": 0,
"value": "C"
},
{
"begin": 473,
"end": 500,
"name": "SSTORE",
"source": 0
},
{
"begin": 518,
"end": 531,
"name": "PUSH #[$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000001"
},
{
"begin": 514,
"end": 516,
"name": "PUSH",
"source": 0,
"value": "D"
},
{
"begin": 507,
"end": 532,
"name": "SSTORE",
"source": 0
},
{
"begin": 550,
"end": 567,
"name": "PUSH [$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000ffffffffffffffff"
},
{
"begin": 546,
"end": 548,
"name": "PUSH",
"source": 0,
"value": "E"
},
{
"begin": 539,
"end": 568,
"name": "SSTORE",
"source": 0
},
{
"begin": 586,
"end": 601,
"name": "PUSH #[$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000ffffffffffffffff"
},
{
"begin": 582,
"end": 584,
"name": "PUSH",
"source": 0,
"value": "F"
},
{
"begin": 575,
"end": 602,
"name": "SSTORE",
"source": 0
}
],
".data":
{
"0":
{
".code":
[
{
"begin": 658,
"end": 673,
"name": "PUSH [$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 654,
"end": 656,
"name": "PUSH",
"source": 0,
"value": "10"
},
{
"begin": 647,
"end": 674,
"name": "SSTORE",
"source": 0
},
{
"begin": 694,
"end": 707,
"name": "PUSH #[$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 690,
"end": 692,
"name": "PUSH",
"source": 0,
"value": "11"
},
{
"begin": 683,
"end": 708,
"name": "SSTORE",
"source": 0
}
],
".data":
{
"0":
{
".code":
[
{
"begin": 761,
"end": 770,
"name": "INVALID",
"source": 0
}
]
}
}
},
"1":
{
".code":
[
{
"begin": 833,
"end": 842,
"name": "INVALID",
"source": 0
}
]
}
}
},
"ACAF3289D7B601CBD114FB36C4D29C85BBFD5E133F14CB355C3FD8D99367964F": "48656c6c6f2c20576f726c6421"
},
"sourceList":
[
"<stdin>"
]
}

View File

@ -0,0 +1,43 @@
object "A" {
code {
sstore(0, dataoffset("A"))
sstore(1, datasize("A"))
sstore(2, dataoffset("B"))
sstore(3, datasize("B"))
sstore(4, dataoffset("B.C"))
sstore(5, datasize("B.C"))
sstore(6, dataoffset("B.E"))
sstore(7, datasize("B.E"))
sstore(8, dataoffset("B.C.D"))
sstore(9, datasize("B.C.D"))
}
data "data1" "Hello, World!"
object "B" {
code {
sstore(10, dataoffset("C"))
sstore(11, datasize("C"))
sstore(12, dataoffset("E"))
sstore(13, datasize("E"))
sstore(14, dataoffset("C.D"))
sstore(15, datasize("C.D"))
}
object "C" {
code {
sstore(16, dataoffset("D"))
sstore(17, datasize("D"))
}
object "D" {
code {
invalid()
}
}
}
object "E" {
code {
invalid()
}
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
--import-asm-json - --opcodes --asm

View File

@ -0,0 +1,5 @@
Uncaught exception:
/solidity/libevmasm/Assembly.cpp(1070): Throw in function vector<size_t> solidity::evmasm::Assembly::decodeSubPath(size_t) const
Dynamic exception type:
std::exception::what: Assertion failed
[solidity::util::tag_comment*] = Assertion failed

View File

@ -0,0 +1 @@
2

View File

@ -0,0 +1,413 @@
{
".code":
[
{
"begin": 36,
"end": 51,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 33,
"end": 34,
"name": "DUP1",
"source": 0
},
{
"begin": 26,
"end": 52,
"name": "SSTORE",
"source": 0
},
{
"begin": 67,
"end": 80,
"name": "PUSHSIZE",
"source": 0
},
{
"begin": 64,
"end": 65,
"name": "PUSH",
"source": 0,
"value": "1"
},
{
"begin": 57,
"end": 81,
"name": "SSTORE",
"source": 0
},
{
"begin": 96,
"end": 111,
"name": "PUSH [$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 93,
"end": 94,
"name": "PUSH",
"source": 0,
"value": "2"
},
{
"begin": 86,
"end": 112,
"name": "SSTORE",
"source": 0
},
{
"begin": 127,
"end": 140,
"name": "PUSH #[$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 124,
"end": 125,
"name": "PUSH",
"source": 0,
"value": "3"
},
{
"begin": 117,
"end": 141,
"name": "SSTORE",
"source": 0
},
{
"begin": 156,
"end": 173,
"name": "PUSH [$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000ffffffffffffffff"
},
{
"begin": 153,
"end": 154,
"name": "PUSH",
"source": 0,
"value": "4"
},
{
"begin": 146,
"end": 174,
"name": "SSTORE",
"source": 0
},
{
"begin": 189,
"end": 204,
"name": "PUSH #[$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000ffffffffffffffff"
},
{
"begin": 186,
"end": 187,
"name": "PUSH",
"source": 0,
"value": "5"
},
{
"begin": 179,
"end": 205,
"name": "SSTORE",
"source": 0
},
{
"begin": 220,
"end": 237,
"name": "PUSH [$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000fffffffffffffffe"
},
{
"begin": 217,
"end": 218,
"name": "PUSH",
"source": 0,
"value": "6"
},
{
"begin": 210,
"end": 238,
"name": "SSTORE",
"source": 0
},
{
"begin": 253,
"end": 268,
"name": "PUSH #[$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000fffffffffffffffe"
},
{
"begin": 250,
"end": 251,
"name": "PUSH",
"source": 0,
"value": "7"
},
{
"begin": 243,
"end": 269,
"name": "SSTORE",
"source": 0
},
{
"begin": 284,
"end": 303,
"name": "PUSH [$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000fffffffffffffffd"
},
{
"begin": 281,
"end": 282,
"name": "PUSH",
"source": 0,
"value": "8"
},
{
"begin": 274,
"end": 304,
"name": "SSTORE",
"source": 0
},
{
"begin": 319,
"end": 336,
"name": "PUSH #[$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000fffffffffffffffd"
},
{
"begin": 316,
"end": 317,
"name": "PUSH",
"source": 0,
"value": "9"
},
{
"begin": 309,
"end": 337,
"name": "SSTORE",
"source": 0
}
],
".data":
{
"0":
{
".code":
[
{
"begin": 418,
"end": 433,
"name": "PUSH [$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 414,
"end": 416,
"name": "PUSH",
"source": 0,
"value": "A"
},
{
"begin": 407,
"end": 434,
"name": "SSTORE",
"source": 0
},
{
"begin": 452,
"end": 465,
"name": "PUSH #[$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 448,
"end": 450,
"name": "PUSH",
"source": 0,
"value": "B"
},
{
"begin": 441,
"end": 466,
"name": "SSTORE",
"source": 0
},
{
"begin": 484,
"end": 499,
"name": "PUSH [$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000001"
},
{
"begin": 480,
"end": 482,
"name": "PUSH",
"source": 0,
"value": "C"
},
{
"begin": 473,
"end": 500,
"name": "SSTORE",
"source": 0
},
{
"begin": 518,
"end": 531,
"name": "PUSH #[$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000001"
},
{
"begin": 514,
"end": 516,
"name": "PUSH",
"source": 0,
"value": "D"
},
{
"begin": 507,
"end": 532,
"name": "SSTORE",
"source": 0
},
{
"begin": 550,
"end": 567,
"name": "PUSH [$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000ffffffffffffffff"
},
{
"begin": 546,
"end": 548,
"name": "PUSH",
"source": 0,
"value": "E"
},
{
"begin": 539,
"end": 568,
"name": "SSTORE",
"source": 0
},
{
"begin": 586,
"end": 601,
"name": "PUSH #[$]",
"source": 0,
"value": "000000000000000000000000000000000000000000000000ffffffffffffffff"
},
{
"begin": 582,
"end": 584,
"name": "PUSH",
"source": 0,
"value": "F"
},
{
"begin": 575,
"end": 602,
"name": "SSTORE",
"source": 0
}
],
".data":
{
"0":
{
".code":
[
{
"begin": 658,
"end": 673,
"name": "PUSH [$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 654,
"end": 656,
"name": "PUSH",
"source": 0,
"value": "10"
},
{
"begin": 647,
"end": 674,
"name": "SSTORE",
"source": 0
},
{
"begin": 694,
"end": 707,
"name": "PUSH #[$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 690,
"end": 692,
"name": "PUSH",
"source": 0,
"value": "11"
},
{
"begin": 683,
"end": 708,
"name": "SSTORE",
"source": 0
}
],
".data":
{
"0":
{
".code":
[
{
"begin": 761,
"end": 770,
"name": "INVALID",
"source": 0
}
]
}
}
},
"1":
{
".code":
[
{
"begin": 833,
"end": 842,
"name": "INVALID",
"source": 0
}
]
}
}
},
"ACAF3289D7B601CBD114FB36C4D29C85BBFD5E133F14CB355C3FD8D99367964F": "48656c6c6f2c20576f726c6421"
},
"sourceList":
[
"<stdin>"
]
}