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] = {
462
462
[_BINARY_OP_SUBTRACT_FLOAT ] = _BINARY_OP_SUBTRACT_FLOAT__NO_DECREF_INPUTS ,
463
463
};
464
464
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 . */
466
466
static int
467
467
optimize_uops (
468
468
PyCodeObject * co ,
@@ -472,6 +472,7 @@ optimize_uops(
472
472
_PyBloomFilter * dependencies
473
473
)
474
474
{
475
+ assert (!PyErr_Occurred ());
475
476
476
477
JitOptContext context ;
477
478
JitOptContext * ctx = & context ;
@@ -555,7 +556,11 @@ optimize_uops(
555
556
OPT_ERROR_IN_OPCODE (opcode );
556
557
}
557
558
_Py_uop_abstractcontext_fini (ctx );
558
- return -1 ;
559
+
560
+ assert (PyErr_Occurred ());
561
+ PyErr_Clear ();
562
+
563
+ return 0 ;
559
564
560
565
}
561
566
@@ -702,10 +707,12 @@ _Py_uop_analyze_and_optimize(
702
707
_PyFrame_GetCode (frame ), buffer ,
703
708
length , curr_stacklen , dependencies );
704
709
705
- if (length < = 0 ) {
710
+ if (length = = 0 ) {
706
711
return length ;
707
712
}
708
713
714
+ assert (length > 0 );
715
+
709
716
length = remove_unneeded_uops (buffer , length );
710
717
assert (length > 0 );
711
718
You can’t perform that action at this time.
0 commit comments