Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dealing with "Out of Memory" errors
#5
Thanks. I've so far been unable to use --debug-array, as it throws a Python error during compilation, which I suspected was because I'd downloaded the platform-independent version and used a separate Python installation. So, I have been trying to check array bounds by hand.

However, fuelled by your feedback, I tried installing a self-contained version of ZXBasic, pre-packaged with Python, on a different computer. Oddly enough I got the same error message, which makes me wonder if it is a problem in my code after all. So, I tried building a simple test program with --debug-array and it worked.

So, now I need to work out why my program can't be compiled with --debug-array. It throws the following error:

Code:
Traceback (most recent call last):
  File "/home/gb/zxbasic/zxbasic/zxbc.py", line 10, in <module>
    sys.exit(libzxbc.main())  # Exit
  File "/home/gb/zxbasic/zxbasic/src/libzxbc/zxbc.py", line 246, in main
    func_visitor.start()
  File "/home/gb/zxbasic/zxbasic/src/arch/zx48k/translator.py", line 1401, in start
    self.visit(f)
  File "/home/gb/zxbasic/zxbasic/src/ast/ast.py", line 35, in visit
    stack.append(last.send(last_result))
  File "/home/gb/zxbasic/zxbasic/src/arch/zx48k/translator.py", line 196, in visit_ARGLIST
    upper = node.parent.entry.bounds[i].upper
  File "/home/gb/zxbasic/zxbasic/src/symbols/boundlist.py", line 29, in __getitem__
    return self.children[key]
  File "/home/gb/zxbasic/zxbasic/src/ast/tree.py", line 40, in __getitem__
    return self._children[key]
IndexError: list index out of range

--though I don't know exactly where this happens in my code.

I'll keep digging. Thanks again,
Georgeo.
Reply


Messages In This Thread
Dealing with "Out of Memory" errors - by georgeo - 03-08-2021, 01:09 PM
RE: Dealing with "Out of Memory" errors - by georgeo - 03-09-2021, 08:47 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)