mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Tolerate ill-formed trees in symtable_assign(). Fixes SF bug 132510.
This commit is contained in:
		
							parent
							
								
									b6a4425392
								
							
						
					
					
						commit
						17820c4f1b
					
				
					 1 changed files with 8 additions and 5 deletions
				
			
		|  | @ -4810,11 +4810,14 @@ symtable_assign(struct symtable *st, node *n, int flag) | |||
| 	default: | ||||
| 		if (NCH(n) == 0) | ||||
| 			return; | ||||
| 		if (NCH(n) != 1) { | ||||
| 			DUMP(n); | ||||
| 			Py_FatalError("too many children in default case\n"); | ||||
| 		if (NCH(n) == 1) { | ||||
| 			n = CHILD(n, 0); | ||||
| 			goto loop; | ||||
| 		} | ||||
| 		n = CHILD(n, 0); | ||||
| 		goto loop; | ||||
| 		/* Should only occur for errors like x + 1 = 1,
 | ||||
| 		   which will be caught in the next pass. */ | ||||
| 		for (i = 0; i < NCH(n); ++i) | ||||
| 			if (TYPE(CHILD(n, i)) >= single_input) | ||||
| 				symtable_assign(st, CHILD(n, i), flag); | ||||
| 	} | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jeremy Hylton
						Jeremy Hylton