Closed
Description
Experimenting with Nimrod today, I was able to make the compiler segfault by attempting to compile:
type Node = tuple[left: ref Node]
proc traverse(root: ref Node) =
if root.left != nil: traverse(root.left)
This code is nonsense, but on the principle that the compiler should never segfault, I'm suggesting this is a bug. I'm not certain what in the code is causing it, but it seems to at least require: the tuple (the equivalent object does not cause a segfault), the recursive reference in the tuple, and the recursive proc.
Nimrod was compiled on Ubuntu 10.04, on an AMD-64 architecture. I'm compiling the above code like so:
james@bast:~/nim_hw$ nimrod c hw.nim
Hint: used config file '/home/james/nimrod/config/nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: hw [Processing]
Segmentation fault