-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing validations in cases where assembly import would silently…
… truncate the value
- Loading branch information
Showing
15 changed files
with
294 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
test/cmdlineTests/standard_import_asm_json_invalid_push_data_value_bad_hex/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"language": "EVMAssembly", | ||
"sources": { | ||
"A": { | ||
"assemblyJson": { | ||
".code": [ | ||
{ | ||
"begin": 0, | ||
"end": 0, | ||
"name": "PUSH data", | ||
"source": 0, | ||
"value": "112233445566778899aabbccddeeff00112233445566778899aabbccddeeffgg" | ||
} | ||
], | ||
"sourceList": [ | ||
"<stdin>" | ||
] | ||
} | ||
} | ||
}, | ||
"settings": { | ||
"outputSelection": { | ||
"*": { | ||
"": ["evm.bytecode"] | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/cmdlineTests/standard_import_asm_json_invalid_push_data_value_bad_hex/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"errors": [ | ||
{ | ||
"component": "general", | ||
"formattedMessage": "Assembly import error: Value provided for instruction 'PUSH data' is not a valid 32-bit hash.", | ||
"message": "Assembly import error: Value provided for instruction 'PUSH data' is not a valid 32-bit hash.", | ||
"severity": "error", | ||
"type": "Exception" | ||
} | ||
] | ||
} |
28 changes: 28 additions & 0 deletions
28
test/cmdlineTests/standard_import_asm_json_invalid_push_data_value_too_long/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"language": "EVMAssembly", | ||
"sources": { | ||
"A": { | ||
"assemblyJson": { | ||
".code": [ | ||
{ | ||
"begin": 0, | ||
"end": 0, | ||
"name": "PUSH data", | ||
"source": 0, | ||
"value": "00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff00" | ||
} | ||
], | ||
"sourceList": [ | ||
"<stdin>" | ||
] | ||
} | ||
} | ||
}, | ||
"settings": { | ||
"outputSelection": { | ||
"*": { | ||
"": ["evm.bytecode"] | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/cmdlineTests/standard_import_asm_json_invalid_push_data_value_too_long/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"errors": [ | ||
{ | ||
"component": "general", | ||
"formattedMessage": "Assembly import error: Value provided for instruction 'PUSH data' is not a valid 32-bit hash.", | ||
"message": "Assembly import error: Value provided for instruction 'PUSH data' is not a valid 32-bit hash.", | ||
"severity": "error", | ||
"type": "Exception" | ||
} | ||
] | ||
} |
28 changes: 28 additions & 0 deletions
28
test/cmdlineTests/standard_import_asm_json_invalid_push_sub_size_value/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"language": "EVMAssembly", | ||
"sources": { | ||
"A": { | ||
"assemblyJson": { | ||
".code": [ | ||
{ | ||
"begin": 0, | ||
"end": 0, | ||
"name": "PUSH #[$]", | ||
"source": 0, | ||
"value": "10000000000000000" | ||
} | ||
], | ||
"sourceList": [ | ||
"<stdin>" | ||
] | ||
} | ||
} | ||
}, | ||
"settings": { | ||
"outputSelection": { | ||
"*": { | ||
"": ["evm.bytecode"] | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/cmdlineTests/standard_import_asm_json_invalid_push_sub_size_value/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"errors": [ | ||
{ | ||
"component": "general", | ||
"formattedMessage": "Assembly import error: Value provided for instruction 'PUSH #[$]' is out of the allowed range [0, 0xffffffffffffffff].", | ||
"message": "Assembly import error: Value provided for instruction 'PUSH #[$]' is out of the allowed range [0, 0xffffffffffffffff].", | ||
"severity": "error", | ||
"type": "Exception" | ||
} | ||
] | ||
} |
28 changes: 28 additions & 0 deletions
28
test/cmdlineTests/standard_import_asm_json_invalid_push_sub_value/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"language": "EVMAssembly", | ||
"sources": { | ||
"A": { | ||
"assemblyJson": { | ||
".code": [ | ||
{ | ||
"begin": 0, | ||
"end": 0, | ||
"name": "PUSH [$]", | ||
"source": 0, | ||
"value": "10000000000000000" | ||
} | ||
], | ||
"sourceList": [ | ||
"<stdin>" | ||
] | ||
} | ||
} | ||
}, | ||
"settings": { | ||
"outputSelection": { | ||
"*": { | ||
"": ["evm.bytecode"] | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/cmdlineTests/standard_import_asm_json_invalid_push_sub_value/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"errors": [ | ||
{ | ||
"component": "general", | ||
"formattedMessage": "Assembly import error: Value provided for instruction 'PUSH [$]' is out of the allowed range [0, 0xffffffffffffffff].", | ||
"message": "Assembly import error: Value provided for instruction 'PUSH [$]' is out of the allowed range [0, 0xffffffffffffffff].", | ||
"severity": "error", | ||
"type": "Exception" | ||
} | ||
] | ||
} |
28 changes: 28 additions & 0 deletions
28
test/cmdlineTests/standard_import_asm_json_invalid_push_tag_value/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"language": "EVMAssembly", | ||
"sources": { | ||
"A": { | ||
"assemblyJson": { | ||
".code": [ | ||
{ | ||
"begin": 0, | ||
"end": 0, | ||
"name": "PUSH [tag]", | ||
"source": 0, | ||
"value": "0x100000000" | ||
} | ||
], | ||
"sourceList": [ | ||
"<stdin>" | ||
] | ||
} | ||
} | ||
}, | ||
"settings": { | ||
"outputSelection": { | ||
"*": { | ||
"": ["evm.bytecode"] | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/cmdlineTests/standard_import_asm_json_invalid_push_tag_value/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"errors": [ | ||
{ | ||
"component": "general", | ||
"formattedMessage": "Assembly import error: Value provided for instruction 'PUSH [tag]' is out of the allowed range [0, 0xffffffff].", | ||
"message": "Assembly import error: Value provided for instruction 'PUSH [tag]' is out of the allowed range [0, 0xffffffff].", | ||
"severity": "error", | ||
"type": "Exception" | ||
} | ||
] | ||
} |
28 changes: 28 additions & 0 deletions
28
test/cmdlineTests/standard_import_asm_json_invalid_push_value/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"language": "EVMAssembly", | ||
"sources": { | ||
"A": { | ||
"assemblyJson": { | ||
".code": [ | ||
{ | ||
"begin": 0, | ||
"end": 10, | ||
"name": "PUSH", | ||
"source": 0, | ||
"value": "00112233445566778899001122334455667788990011223344556677889900112233445566778899" | ||
} | ||
], | ||
"sourceList": [ | ||
"<stdin>" | ||
] | ||
} | ||
} | ||
}, | ||
"settings": { | ||
"outputSelection": { | ||
"*": { | ||
"": ["evm.bytecode"] | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/cmdlineTests/standard_import_asm_json_invalid_push_value/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"errors": [ | ||
{ | ||
"component": "general", | ||
"formattedMessage": "Assembly import error: Value provided for instruction 'PUSH' is out of the allowed range [0, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff].", | ||
"message": "Assembly import error: Value provided for instruction 'PUSH' is out of the allowed range [0, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff].", | ||
"severity": "error", | ||
"type": "Exception" | ||
} | ||
] | ||
} |
28 changes: 28 additions & 0 deletions
28
test/cmdlineTests/standard_import_asm_json_invalid_tag_value/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"language": "EVMAssembly", | ||
"sources": { | ||
"A": { | ||
"assemblyJson": { | ||
".code": [ | ||
{ | ||
"begin": 0, | ||
"end": 0, | ||
"name": "tag", | ||
"source": 0, | ||
"value": "0x100000000" | ||
} | ||
], | ||
"sourceList": [ | ||
"<stdin>" | ||
] | ||
} | ||
} | ||
}, | ||
"settings": { | ||
"outputSelection": { | ||
"*": { | ||
"": ["evm.bytecode"] | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/cmdlineTests/standard_import_asm_json_invalid_tag_value/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"errors": [ | ||
{ | ||
"component": "general", | ||
"formattedMessage": "Assembly import error: Value provided for instruction 'tag' is out of the allowed range [0, 0xffffffff].", | ||
"message": "Assembly import error: Value provided for instruction 'tag' is out of the allowed range [0, 0xffffffff].", | ||
"severity": "error", | ||
"type": "Exception" | ||
} | ||
] | ||
} |