diff options
author | chriseth <chris@ethereum.org> | 2018-03-22 01:12:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-22 01:12:41 +0800 |
commit | 85b0cfea9a232b10f88a8eca6cdb132706bac5e5 (patch) | |
tree | 6b6c7c2f6c2d17fb39540a0679fa9627682f9623 /libsolidity/codegen/CompilerUtils.h | |
parent | 8fd53c1c030b45282af3ebc80af72e17cab1d6d8 (diff) | |
parent | c7860a0fba74a4b62dfb93070544230e74ce98ab (diff) | |
download | dexon-solidity-85b0cfea9a232b10f88a8eca6cdb132706bac5e5.tar.gz dexon-solidity-85b0cfea9a232b10f88a8eca6cdb132706bac5e5.tar.zst dexon-solidity-85b0cfea9a232b10f88a8eca6cdb132706bac5e5.zip |
Merge pull request #3308 from ethereum/usereturndatacopy
Use returndatacopy for retrieving dynamically sized outputs.
Diffstat (limited to 'libsolidity/codegen/CompilerUtils.h')
-rw-r--r-- | libsolidity/codegen/CompilerUtils.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index 3cde281b..76670d47 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -88,6 +88,15 @@ public: /// Stack post: (memory_offset+length) void storeInMemoryDynamic(Type const& _type, bool _padToWords = true); + /// Creates code that unpacks the arguments according to their types specified by a vector of TypePointers. + /// From memory if @a _fromMemory is true, otherwise from call data. + /// Calls revert if @a _revertOnOutOfBounds is true and the supplied size is shorter + /// than the static data requirements or if dynamic data pointers reach outside of the + /// area. Also has a hard cap of 0x100000000 for any given length/offset field. + /// Stack pre: <source_offset> <length> + /// Stack post: <value0> <value1> ... <valuen> + void abiDecode(TypePointers const& _typeParameters, bool _fromMemory = false, bool _revertOnOutOfBounds = false); + /// Copies values (of types @a _givenTypes) given on the stack to a location in memory given /// at the stack top, encoding them according to the ABI as the given types @a _targetTypes. /// Removes the values from the stack and leaves the updated memory pointer. @@ -149,7 +158,7 @@ public: /// Decodes data from ABI encoding into internal encoding. If @a _fromMemory is set to true, /// the data is taken from memory instead of from calldata. /// Can allocate memory. - /// Stack pre: <source_offset> + /// Stack pre: <source_offset> <length> /// Stack post: <value0> <value1> ... <valuen> void abiDecodeV2(TypePointers const& _parameterTypes, bool _fromMemory = false); |