File tree 1 file changed +16
-2
lines changed
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -1090,13 +1090,27 @@ static int
1090
1090
_PyFrame_OpAlreadyRan (_PyInterpreterFrame * frame , int opcode , int oparg )
1091
1091
{
1092
1092
// This only works when opcode is a non-quickened form:
1093
+ assert (opcode != ENTER_EXECUTOR );
1093
1094
assert (_PyOpcode_Deopt [opcode ] == opcode );
1094
1095
int check_oparg = 0 ;
1096
+ PyCodeObject * code = _PyFrame_GetCode (frame );
1095
1097
for (_Py_CODEUNIT * instruction = _PyCode_CODE (_PyFrame_GetCode (frame ));
1096
1098
instruction < frame -> instr_ptr ; instruction ++ )
1097
1099
{
1098
- int check_opcode = _PyOpcode_Deopt [instruction -> op .code ];
1099
- check_oparg |= instruction -> op .arg ;
1100
+ int check_opcode = -1 ;
1101
+ if (instruction -> op .code == ENTER_EXECUTOR ) {
1102
+ int exec_index = instruction -> op .arg ;
1103
+ _PyExecutorObject * exec = code -> co_executors -> executors [exec_index ];
1104
+ check_opcode = exec -> vm_data .opcode ;
1105
+ check_oparg |= exec -> vm_data .oparg ;
1106
+ }
1107
+ else {
1108
+ check_opcode = _PyOpcode_Deopt [instruction -> op .code ];
1109
+ check_oparg |= instruction -> op .arg ;
1110
+ }
1111
+
1112
+ assert (check_opcode != ENTER_EXECUTOR );
1113
+
1100
1114
if (check_opcode == opcode && check_oparg == oparg ) {
1101
1115
return 1 ;
1102
1116
}
You can’t perform that action at this time.
0 commit comments