77
88#include  "Python.h" 
99
10- #include  "pycore_compile.h"  // _PyCompile_EnsureArrayLargeEnough 
10+ #include  "pycore_c_array.h"  // _Py_EnsureArrayLargeEnough 
11+ #include  "pycore_compile.h"  // _PyInstruction 
1112#include  "pycore_opcode_utils.h" 
1213#include  "pycore_opcode_metadata.h"  // OPCODE_HAS_ARG, etc 
1314
@@ -37,11 +38,11 @@ instr_sequence_next_inst(instr_sequence *seq) {
3738    assert (seq -> s_instrs  !=  NULL  ||  seq -> s_used  ==  0 );
3839
3940    RETURN_IF_ERROR (
40-         _PyCompile_EnsureArrayLargeEnough (seq -> s_used  +  1 ,
41-                                            (void * * )& seq -> s_instrs ,
42-                                            & seq -> s_allocated ,
43-                                            INITIAL_INSTR_SEQUENCE_SIZE ,
44-                                            sizeof (instruction )));
41+         _Py_EnsureArrayLargeEnough (seq -> s_used  +  1 ,
42+                                    (void * * )& seq -> s_instrs ,
43+                                    & seq -> s_allocated ,
44+                                    INITIAL_INSTR_SEQUENCE_SIZE ,
45+                                    sizeof (instruction )));
4546    assert (seq -> s_allocated  >= 0 );
4647    assert (seq -> s_used  <  seq -> s_allocated );
4748    return  seq -> s_used ++ ;
@@ -59,11 +60,11 @@ _PyInstructionSequence_UseLabel(instr_sequence *seq, int lbl)
5960{
6061    int  old_size  =  seq -> s_labelmap_size ;
6162    RETURN_IF_ERROR (
62-         _PyCompile_EnsureArrayLargeEnough (lbl ,
63-                                            (void * * )& seq -> s_labelmap ,
64-                                             & seq -> s_labelmap_size ,
65-                                             INITIAL_INSTR_SEQUENCE_LABELS_MAP_SIZE ,
66-                                             sizeof (int )));
63+         _Py_EnsureArrayLargeEnough (lbl ,
64+                                    (void * * )& seq -> s_labelmap ,
65+                                    & seq -> s_labelmap_size ,
66+                                    INITIAL_INSTR_SEQUENCE_LABELS_MAP_SIZE ,
67+                                    sizeof (int )));
6768
6869    for (int  i  =  old_size ; i  <  seq -> s_labelmap_size ; i ++ ) {
6970        seq -> s_labelmap [i ] =  -111 ;  /* something weird, for debugging */ 
0 commit comments