mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #1619 from ethereum/changelog
Mention in changelog that invalid as an opcode is valid inline assembly
This commit is contained in:
commit
edd3696dc1
@ -4,13 +4,14 @@ Features:
|
||||
* Compiler interface: Contracts and libraries can be referenced with a ``file:`` prefix to make them unique.
|
||||
* Compiler interface: Report source location for "stack too deep" errors.
|
||||
* AST: Use deterministic node identifiers.
|
||||
* Inline assembly: introduce ``invalid`` (EIP141) as an opcode.
|
||||
* Type system: Introduce type identifier strings.
|
||||
* Type checker: Warn about invalid checksum for addresses and deduce type from valid ones.
|
||||
* Metadata: Do not include platform in the version number.
|
||||
* Metadata: Add option to store sources as literal content.
|
||||
* Code generator: Extract array utils into low-level functions.
|
||||
* Code generator: Internal errors (array out of bounds, etc.) now cause a reversion by using an invalid
|
||||
instruction (0xfe) instead of an invalid jump. Invalid jump is still kept for explicit throws.
|
||||
instruction (0xfe - EIP141) instead of an invalid jump. Invalid jump is still kept for explicit throws.
|
||||
|
||||
Bugfixes:
|
||||
* Code generator: Allow recursive structs.
|
||||
|
@ -632,6 +632,8 @@ The opcodes ``pushi`` and ``jumpdest`` cannot be used directly.
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| selfdestruct(a) | `-` | end execution, destroy current contract and send funds to a |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| invalid | `-` | end execution with invalid instruction |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| log0(p, s) | `-` | log without topics and data mem[p..(p+s)) |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| log1(p, s, t1) | `-` | log with topic t1 and data mem[p..(p+s)) |
|
||||
|
@ -182,6 +182,11 @@ BOOST_AUTO_TEST_CASE(error_tag)
|
||||
BOOST_CHECK(successAssemble("{ invalidJumpLabel }"));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(designated_invalid_instruction)
|
||||
{
|
||||
BOOST_CHECK(successAssemble("{ invalid }"));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inline_assembly_shadowed_instruction_declaration)
|
||||
{
|
||||
// Error message: "Cannot use instruction names for identifier names."
|
||||
|
@ -9043,6 +9043,21 @@ BOOST_AUTO_TEST_CASE(recursive_structs)
|
||||
BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(1)));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(invalid_instruction)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract C {
|
||||
function f() {
|
||||
assembly {
|
||||
invalid
|
||||
}
|
||||
}
|
||||
}
|
||||
)";
|
||||
compileAndRun(sourceCode, 0, "C");
|
||||
BOOST_CHECK(callContractFunction("f()") == encodeArgs());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user