Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: Project 8 FibonacciElement test cases appear off by one #547

Open
2 tasks done
maueroats opened this issue Dec 27, 2024 · 0 comments
Open
2 tasks done

[bug]: Project 8 FibonacciElement test cases appear off by one #547

maueroats opened this issue Dec 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@maueroats
Copy link

Tool

General

Interface

None

Contact Details

No response

What happened?

I believe that the memory location of the return value from Fibonacci(4) should be 262 not 261.

See PR #546 for the VM version of this error.

There is a similar error in the Hack assembler version of the testing.

You should double-check this, since it seems suspicious that I am "discovering" this error at this point in the development.

Where is the master version of these files? I will be glad to file a PR against it.

Details

In the assembler version, SP=256 at the start.
Then the stack upon calling the Fibonacci function for the first time contains:

  • the argument to Fibonacci, which is the number 4
  • return address
  • args, local, this, that

That means SP=262 at the start of the function call.

Both test scripts assert that the return value from the first Fibonacci function is at RAM[261], but I think it should be RAM[262].

Additional Comments

No response

Do you want to try to fix this bug?

  • I want to try to add this feature!

Code of Conduct

  • I agree to follow this project's Code of Conduct
@maueroats maueroats added the bug Something isn't working label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant