mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Merge pull request #10945 from ethereum/constructor-modifier-bugfix
Fix IR bug about calling the wrong modifier during construction
This commit is contained in:
		
						commit
						215233d5c8
					
				| @ -727,7 +727,7 @@ void IRGenerator::generateImplicitConstructors(ContractDefinition const& _contra | ||||
| 						generateModifier(modifier, *constructor, next); | ||||
| 					} | ||||
| 					body = | ||||
| 						IRNames::modifierInvocation(*constructor->modifiers().at(0)) + | ||||
| 						IRNames::modifierInvocation(*realModifiers.at(0)) + | ||||
| 						"(" + | ||||
| 						joinHumanReadable(params) + | ||||
| 						")"; | ||||
|  | ||||
| @ -0,0 +1,7 @@ | ||||
| // The IR of this contract used to throw | ||||
| contract A { modifier m1{_;} } | ||||
| contract B is A { constructor() A() m1{} } | ||||
| // ==== | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // constructor() -> | ||||
| @ -0,0 +1,13 @@ | ||||
| // The IR of this contract used to throw | ||||
| contract A { | ||||
|   constructor() m1 { } | ||||
|   modifier m1 { _; } | ||||
| } | ||||
| contract B is A { | ||||
|   modifier m2 { _; } | ||||
|   constructor() A() m1 m2 {  } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // constructor() -> | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user