mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix static arrays with dynamic elements not being treated as dynamic in FunctionType::returnParameterTypesWithoutDynamicTypes()
This commit is contained in:
parent
b08b76ffca
commit
2916ae5bda
@ -16,6 +16,7 @@ Compiler Features:
|
|||||||
|
|
||||||
|
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
* Code generator: Fix internal error on stripping dynamic types from return parameters on EVM versions without ``RETURNDATACOPY``.
|
||||||
* Type Checker: Disallow ``virtual`` for modifiers in libraries.
|
* Type Checker: Disallow ``virtual`` for modifiers in libraries.
|
||||||
* Type Checker: Correct the warning for homonymous, but not shadowing declarations.
|
* Type Checker: Correct the warning for homonymous, but not shadowing declarations.
|
||||||
* ViewPureChecker: Prevent visibility check on constructors.
|
* ViewPureChecker: Prevent visibility check on constructors.
|
||||||
|
@ -3010,7 +3010,7 @@ TypePointers FunctionType::returnParameterTypesWithoutDynamicTypes() const
|
|||||||
m_kind == Kind::BareStaticCall
|
m_kind == Kind::BareStaticCall
|
||||||
)
|
)
|
||||||
for (auto& param: returnParameterTypes)
|
for (auto& param: returnParameterTypes)
|
||||||
if (param->isDynamicallySized() && !param->dataStoredIn(DataLocation::Storage))
|
if (param->isDynamicallyEncoded() && !param->dataStoredIn(DataLocation::Storage))
|
||||||
param = TypeProvider::inaccessibleDynamic();
|
param = TypeProvider::inaccessibleDynamic();
|
||||||
|
|
||||||
return returnParameterTypes;
|
return returnParameterTypes;
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
pragma experimental ABIEncoderV2;
|
||||||
|
|
||||||
|
contract C {
|
||||||
|
struct S {
|
||||||
|
bool[] b;
|
||||||
|
}
|
||||||
|
|
||||||
|
function f() public returns (uint256, bool[][2] memory, S[2] memory, uint256) {
|
||||||
|
return (
|
||||||
|
5,
|
||||||
|
[new bool[](1), new bool[](2)],
|
||||||
|
[S(new bool[](2)), S(new bool[](5))],
|
||||||
|
6
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function g() public returns (uint256, uint256) {
|
||||||
|
(uint256 a, , , uint256 b) = this.f();
|
||||||
|
return (a, b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// g() -> 5, 6
|
Loading…
Reference in New Issue
Block a user