From 28f1709777cbd99dc96dcdbbef8c532674bfbc86 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 6 Jun 2017 14:58:32 +0200 Subject: [PATCH] Fail on access beyond end. --- EIPS/returndatacopy.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/EIPS/returndatacopy.md b/EIPS/returndatacopy.md index 9689f459..11c80fba 100644 --- a/EIPS/returndatacopy.md +++ b/EIPS/returndatacopy.md @@ -40,9 +40,7 @@ Gas costs: 2 (same as `CALLDATASIZE`) `RETURNDATACOPY`: `0x3e` -This opcode has similar semantics to `CALLDATACOPY`, but instead of copying data from the call data, it copies data from the return data buffer. If the return data buffer is accessed beyond its size, it is considered to be filled with zeros. - -ALTERNATIVE: If the return data is accessed beyond its size, results in failure. +This opcode has similar semantics to `CALLDATACOPY`, but instead of copying data from the call data, it copies data from the return data buffer. Furthermore, accessing the return data buffer beyond its size results in a failure, i.e. if `start + length` overflows or results in a value larger than `RETURNDATASIZE`, the current call stops in an out-of-gas condition. Gas costs: `3 + 3 * ceil(amount / 32)` (same as `CALLDATACOPY`)