Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when declaring external function with array of struct that possesses arrays #4713

Closed
mattaereal opened this issue Aug 6, 2018 · 4 comments
Assignees
Labels

Comments

@mattaereal
Copy link
Contributor

mattaereal commented Aug 6, 2018

This issue is being reported as part of the current audit being held by Zeppelin Solutions to Solidity's compiler (tag v0.4.24).

Description

Compiler crashes using pragma experimental ABIEncoderV2, when an array of structs that is composed by one or more arrays is used as a parameter on an external function of a library.

Error in file

Empty message.
libsolidity/codegen/ABIFunctions.cpp(1191)

Displayed message

Throw in function std::__cxx11::string dev::solidity::ABIFunctions::abiDecodingFunctionCalldataArray(const dev::solidity::ArrayType&)

Example code

pragma experimental ABIEncoderV2;                                                                                                              
pragma solidity ^0.4.24;                                                                                                                       
                                                                                                                                              
library Test {                                                                                                                                 
   struct Nested { int[] a; }                                                                                                                 
   function Y(Nested[]) external {}                                                                                                           
}
@axic
Copy link
Member

axic commented Aug 6, 2018

Reproducible in 0.4.24 and still happens on develop (albeit has a nicer message):

Unimplemented feature:
/Users/alex/Projects/solidity/libsolidity/codegen/ABIFunctions.cpp(1191): Throw in function std::__1::string dev::solidity::ABIFunctions::abiDecodingFunctionCalldataArray(const dev::solidity::ArrayType &)
Dynamic exception type: boost::exception_detail::clone_impl<dev::solidity::UnimplementedFeatureError>
std::exception::what: Calldata arrays with non-value base types are not yet supported by Solidity.
[dev::tag_comment*] = Calldata arrays with non-value base types are not yet supported by Solidity.

@axic axic added the bug 🐛 label Aug 6, 2018
@christianparpart
Copy link
Member

@axic I just tested it right now with develop. and It's compiling fine now.

@christianparpart christianparpart self-assigned this Aug 27, 2018
@christianparpart
Copy link
Member

@axic I've been bisecting this, and now it becomes clear. It got fixed in via #4738, i.e. we enforce a data location in function args now, so this bug cannot occur anymore. Should we close this issue then?

@leonardoalt
Copy link
Member

Closing since the crash is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants