Skip to content

fix: make SimpleFunction directory able to upload#628

Merged
DavidSouther merged 2 commits intonand2tetris:mainfrom
mmatsumoto1026:fix/make-SimpleFunction-directory-able-to-upload
Feb 3, 2026
Merged

fix: make SimpleFunction directory able to upload#628
DavidSouther merged 2 commits intonand2tetris:mainfrom
mmatsumoto1026:fix/make-SimpleFunction-directory-able-to-upload

Conversation

@mmatsumoto1026
Copy link
Copy Markdown
Contributor

@mmatsumoto1026 mmatsumoto1026 commented Jan 4, 2026

Closes #621

This PR will make SimpleFunction directory able to upload without the runtime error by returning empty array as the values property of the stack object, when the number of items on the stack for the current function frame is equal to or less than zero.

@mmatsumoto1026 mmatsumoto1026 marked this pull request as draft January 6, 2026 03:26
@mmatsumoto1026 mmatsumoto1026 marked this pull request as ready for review January 6, 2026 06:54
Copy link
Copy Markdown
Collaborator

@DavidSouther DavidSouther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a unit test showing the failing and (now) passing behavior?

@mmatsumoto1026
Copy link
Copy Markdown
Contributor Author

Thanks for your review.

The vm.test.ts and vm.ts are updated to add a unit test which detect the assertion failed error in memory.ts when invalid property of the stack object are passed.

@DavidSouther DavidSouther merged commit df2d265 into nand2tetris:main Feb 3, 2026
1 check passed
@mmatsumoto1026 mmatsumoto1026 deleted the fix/make-SimpleFunction-directory-able-to-upload branch February 3, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

upload of project 8, SimpleFunction directory into VM emulator causes Runtime Error: Invalid Stack

2 participants