mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Disable large arrays for memory location too
This commit is contained in:
		
							parent
							
								
									e640bb2aed
								
							
						
					
					
						commit
						4229caaadc
					
				| @ -586,7 +586,11 @@ bool TypeChecker::visit(VariableDeclaration const& _variable) | ||||
| 
 | ||||
| 	if (varType->category() == Type::Category::Array) | ||||
| 		if (auto arrayType = dynamic_cast<ArrayType const*>(varType.get())) | ||||
| 			if ((arrayType->location() == DataLocation::CallData) && !arrayType->validForCalldata()) | ||||
| 			if ( | ||||
| 				((arrayType->location() == DataLocation::Memory) || | ||||
| 				(arrayType->location() == DataLocation::CallData)) && | ||||
| 				!arrayType->validForCalldata() | ||||
| 			) | ||||
| 				m_errorReporter.typeError(_variable.location(), "Array is too large to be encoded as calldata."); | ||||
| 
 | ||||
| 	return false; | ||||
|  | ||||
| @ -6319,7 +6319,7 @@ BOOST_AUTO_TEST_CASE(too_large_arrays_for_calldata) | ||||
| 			} | ||||
| 		} | ||||
| 	)"; | ||||
| 	CHECK_SUCCESS_NO_WARNINGS(text); | ||||
| 	CHECK_ERROR(text, TypeError, "Array is too large to be encoded as calldata."); | ||||
| } | ||||
| 
 | ||||
| BOOST_AUTO_TEST_SUITE_END() | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user