Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#243 closed defect (fixed)

Fix all the loop bugs

Reported by: robertwb Owned by: robertwb
Priority: critical Milestone: 0.11.1
Component: Python Semantics Keywords:


def test_loop(N):
    cdef int i
    for i in range(N):
        print i
        i = 5
    return i


>>> loop.test_loop(3)
>>> loop.test_loop(10)

where the later is an infinite loop. What I think we *should* do is have a shadow loop variable in the C for loop, and assign it to the target loop variable at the top of the loop.

This would also independently solve #208 and #196 without a performance penalty.

Change History (5)

comment:1 Changed 7 years ago by dagss

  • Milestone changed from 0.10.1 to 0.11.1

comment:3 Changed 7 years ago by robertwb

  • Resolution set to fixed
  • Status changed from new to closed

comment:4 Changed 7 years ago by robertwb

  • Component changed from Code Generation to Python Semantics

comment:5 Changed 7 years ago by robertwb

  • Summary changed from another for in range loop bug to Fix all the loop bugs
Note: See TracTickets for help on using tickets.