mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	ceval: Use _PyTuple_FromArraySteal in BUILD_TUPLE (GH-96516)
This commit is contained in:
		
							parent
							
								
									f2d749a2c2
								
							
						
					
					
						commit
						4781535a57
					
				
					 1 changed files with 2 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -2650,13 +2650,10 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
 | 
			
		|||
        }
 | 
			
		||||
 | 
			
		||||
        TARGET(BUILD_TUPLE) {
 | 
			
		||||
            PyObject *tup = PyTuple_New(oparg);
 | 
			
		||||
            STACK_SHRINK(oparg);
 | 
			
		||||
            PyObject *tup = _PyTuple_FromArraySteal(stack_pointer, oparg);
 | 
			
		||||
            if (tup == NULL)
 | 
			
		||||
                goto error;
 | 
			
		||||
            while (--oparg >= 0) {
 | 
			
		||||
                PyObject *item = POP();
 | 
			
		||||
                PyTuple_SET_ITEM(tup, oparg, item);
 | 
			
		||||
            }
 | 
			
		||||
            PUSH(tup);
 | 
			
		||||
            DISPATCH();
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue