diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 65d9abf06..98d3b075b 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -2837,6 +2837,8 @@ unsigned FunctionType::sizeOnStack() const case Kind::ArrayPush: case Kind::ArrayPop: case Kind::ByteArrayPush: + case Kind::Transfer: + case Kind::Send: size = 1; break; default: diff --git a/test/libsolidity/semanticTests/expressions/uncalled_address_transfer_send.sol b/test/libsolidity/semanticTests/expressions/uncalled_address_transfer_send.sol new file mode 100644 index 000000000..0df70f935 --- /dev/null +++ b/test/libsolidity/semanticTests/expressions/uncalled_address_transfer_send.sol @@ -0,0 +1,12 @@ +contract TransferTest { + function() external payable { + // This used to cause an ICE + address(this).transfer; + } + + function f() pure public {} +} +// ==== +// compileViaYul: also +// ---- +// f() ->