File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,12 @@ def for_loop_helper_with_index(
183183
184184 builder .push_loop_stack (step_block , exit_block )
185185
186- builder .goto_and_activate (condition_block )
186+ if isinstance (length , Integer ) and length .value > 0 :
187+ builder .goto (body_block )
188+ builder .activate_block (condition_block )
189+ else :
190+ builder .goto_and_activate (condition_block )
191+
187192 for_gen .gen_condition ()
188193
189194 builder .activate_block (body_block )
Original file line number Diff line number Diff line change 645645 r0 = 'abc'
646646 r1 = PyList_New(3)
647647 r2 = 0
648+ goto L2
648649L1:
649650 r3 = r2 < 3 :: signed
650651 if r3 goto L2 else goto L4 :: bool
690691 r0 = 'abc'
691692 r1 = PyList_New(3)
692693 r2 = 0
694+ goto L2
693695L1:
694696 r3 = r2 < 3 :: signed
695697 if r3 goto L2 else goto L4 :: bool
798800 r0 = b'abc'
799801 r1 = PyList_New(3)
800802 r2 = 0
803+ goto L2
801804L1:
802805 r3 = r2 < 3 :: signed
803806 if r3 goto L2 else goto L8 :: bool
952955 r18 = CPyList_Extend(r10, r17)
953956 r19 = PyList_New(13)
954957 r20 = 0
958+ goto L2
955959L1:
956960 r21 = var_object_size r10
957961 r22 = r20 < r21 :: signed
968972L4:
969973 a = r19
970974 return 1
975+
Original file line number Diff line number Diff line change 417417 r0 = 'abc'
418418 r1 = PyTuple_New(3)
419419 r2 = 0
420+ goto L2
420421L1:
421422 r3 = r2 < 3 :: signed
422423 if r3 goto L2 else goto L4 :: bool
462463 r0 = 'abc'
463464 r1 = PyTuple_New(3)
464465 r2 = 0
466+ goto L2
465467L1:
466468 r3 = r2 < 3 :: signed
467469 if r3 goto L2 else goto L4 :: bool
570572 r0 = b'abc'
571573 r1 = PyTuple_New(3)
572574 r2 = 0
575+ goto L2
573576L1:
574577 r3 = r2 < 3 :: signed
575578 if r3 goto L2 else goto L8 :: bool
879882 r18 = CPyList_Extend(r10, r17)
880883 r19 = PyTuple_New(13)
881884 r20 = 0
885+ goto L2
882886L1:
883887 r21 = var_object_size r10
884888 r22 = r20 < r21 :: signed
You can’t perform that action at this time.
0 commit comments