← 输入框|github.com|刷新
Skip to content

list.pop segmentation fault #2215

Closed

Description

@davidbrochart

The following code segfaults:

from lpython import i32

a: list[i32] = []
i: i32
for i in range(10):
    a.append(1)
    a.pop()

Commenting out a.pop() doesn't segfaults, or even replacing it with print(a.pop()).

Activity

  1. Thirumalai-Shaktivel commented on Jul 29, 2023

    @Thirumalai-Shaktivel
    Collaborator

    Thanks @davidbrochart for trying out LPython!
    The issue seemed to be fixed! Here is the current output:

    from lpython import i32
    
    a: list[i32] = []
    i: i32
    for i in range(10):
        a.append(1)
        if i > 5:
            a.pop()
    
    print(a)

    Output

    $ lpython examples/expr2.py
    [1, 1, 1, 1, 1, 1]

    You can try out other programs. If you face any issues, please let us know!
    Thank you!

  2. davidbrochart commented on Jul 29, 2023

    @davidbrochart
    Author

    Awesome, keep up the great work! LPython rocks 🚀

  3. certik commented on Jul 29, 2023

    @certik
    Contributor

    Thank you @davidbrochart for trying LPython and thank you for the excellent bug report. As you can see, it was fixed in 1h. Good bug reports we can fix quickly. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions