aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/CompilerUtils.h
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-12-14 00:23:37 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-03-21 22:53:25 +0800
commit32c94f505901201126000eb12087251f5695acbd (patch)
tree2e398f44ddfe0784d65688f4dd4286e9befc5aeb /libsolidity/codegen/CompilerUtils.h
parent2cdf44f65cdd15f31293ae2fa78d9996d6219af0 (diff)
downloaddexon-solidity-32c94f505901201126000eb12087251f5695acbd.tar.gz
dexon-solidity-32c94f505901201126000eb12087251f5695acbd.tar.zst
dexon-solidity-32c94f505901201126000eb12087251f5695acbd.zip
Simple size check for old ABI decoder.
Diffstat (limited to 'libsolidity/codegen/CompilerUtils.h')
-rw-r--r--libsolidity/codegen/CompilerUtils.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h
index 9fc97b9e..76670d47 100644
--- a/libsolidity/codegen/CompilerUtils.h
+++ b/libsolidity/codegen/CompilerUtils.h
@@ -90,8 +90,12 @@ public:
/// 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.
- /// Expects source offset on the stack, which is removed.
- void abiDecode(TypePointers const& _typeParameters, bool _fromMemory = false);
+ /// 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.
@@ -154,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);