mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Only forward returndata if EVM version supports it.
This commit is contained in:
		
							parent
							
								
									42c4c78390
								
							
						
					
					
						commit
						fcb7a27216
					
				| @ -264,7 +264,7 @@ CompilerContext& CompilerContext::appendRevert() | ||||
| 
 | ||||
| CompilerContext& CompilerContext::appendConditionalRevert(bool _forwardReturnData) | ||||
| { | ||||
| 	if (_forwardReturnData) | ||||
| 	if (_forwardReturnData && m_evmVersion.supportsReturndata()) | ||||
| 		appendInlineAssembly(R"({ | ||||
| 			if condition { | ||||
| 				returndatacopy(0, 0, returndatasize()) | ||||
|  | ||||
| @ -158,6 +158,8 @@ public: | ||||
| 	CompilerContext& appendRevert(); | ||||
| 	/// Appends a conditional REVERT-call, either forwarding the RETURNDATA or providing the
 | ||||
| 	/// empty string. Consumes the condition.
 | ||||
| 	/// If the current EVM version does not support RETURNDATA, uses REVERT but does not forward
 | ||||
| 	/// the data.
 | ||||
| 	CompilerContext& appendConditionalRevert(bool _forwardReturnData = false); | ||||
| 	/// Appends a JUMP to a specific tag
 | ||||
| 	CompilerContext& appendJumpTo(eth::AssemblyItem const& _tag) { m_asm->appendJump(_tag); return *this; } | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user