Skip to content

Segmetation fault if creating SegmentTree from empty array #2

Description

@abrikos110
>>> import sys
>>> import segment_tree
>>> 
>>> sys.setrecursionlimit(10**7)
>>> segment_tree.SegmentTree([])
Segmentation fault (core dumped)
>>> import segment_tree
>>> 
>>> segment_tree.SegmentTree([])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/anaconda3/lib/python3.6/site-packages/segment_tree/segment_tree.py", line 25, in __init__
    self.root = SegmentTreeNode(0, len(array) - 1, self)
  File "/home/user/anaconda3/lib/python3.6/site-packages/segment_tree/segment_tree.py", line 88, in __init__
    segment_tree)
  File "/home/user/anaconda3/lib/python3.6/site-packages/segment_tree/segment_tree.py", line 88, in __init__
    segment_tree)
  File "/home/user/anaconda3/lib/python3.6/site-packages/segment_tree/segment_tree.py", line 88, in __init__
    segment_tree)
  [Previous line repeated 244 more times]
RecursionError: maximum recursion depth exceeded
>>> 

If you create SegmentTree from empty array the infinite recursion occurs

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions