File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -462,7 +462,7 @@ const uint16_t op_without_decref_inputs[MAX_UOP_ID + 1] = {
462462 [_BINARY_OP_SUBTRACT_FLOAT ] = _BINARY_OP_SUBTRACT_FLOAT__NO_DECREF_INPUTS ,
463463};
464464
465- /* 1 for success, 0 for not ready, cannot error at the moment . */
465+ /* >0 (length) for success, 0 for not ready, clears all possible errors . */
466466static int
467467optimize_uops (
468468 PyCodeObject * co ,
@@ -472,6 +472,7 @@ optimize_uops(
472472 _PyBloomFilter * dependencies
473473)
474474{
475+ assert (!PyErr_Occurred ());
475476
476477 JitOptContext context ;
477478 JitOptContext * ctx = & context ;
@@ -555,7 +556,11 @@ optimize_uops(
555556 OPT_ERROR_IN_OPCODE (opcode );
556557 }
557558 _Py_uop_abstractcontext_fini (ctx );
558- return -1 ;
559+
560+ assert (PyErr_Occurred ());
561+ PyErr_Clear ();
562+
563+ return 0 ;
559564
560565}
561566
@@ -702,10 +707,12 @@ _Py_uop_analyze_and_optimize(
702707 _PyFrame_GetCode (frame ), buffer ,
703708 length , curr_stacklen , dependencies );
704709
705- if (length < = 0 ) {
710+ if (length = = 0 ) {
706711 return length ;
707712 }
708713
714+ assert (length > 0 );
715+
709716 length = remove_unneeded_uops (buffer , length );
710717 assert (length > 0 );
711718
You can’t perform that action at this time.
0 commit comments