Skip to content

Fibonacci function will cause segmentation fault (see description) #50

@sebbekarlsson

Description

@sebbekarlsson

The following function will cause segmentation fault:

Function Fibonacci(N)
  If N < 2 Then
    Fibonacci = N
  Else
    Fibonacci = Fibonacci(N - 1) + Fibonacci(N - 2)
  End If
End Function

This is probably a scoping problem and a return problem.
When an AST tree has been built for lets say this function for example, it will
contain multiple Return-AST-nodes, which I think causes a problem somehow.

I think there might also be a problem with the recursive calls modifying the same scope....
but I dont know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions