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

Fix OPEN COM from locking up inside gfs_open_com_syntax() #428

Merged
merged 3 commits into from
Jan 5, 2024

Conversation

a740g
Copy link
Contributor

@a740g a740g commented Jan 4, 2024

This PR fixes an OPEN COM statement from locking up inside gfs_open_com_syntax().

For example, the following code crashes with v3.9.0, v3.9.1 and locks up on later versions.

The issue was first reported here: https://qb64phoenix.com/forum/showthread.php?tid=2376&pid=22478#pid22478

ON ERROR GOTO Handler
OPEN "COM4:74880,N,8,1,BIN,CS0,DS0,RB8192" FOR RANDOM AS #99
END

Handler:
PRINT "Error:"; ERR
RESUME NEXT

With the changes in the PR, this no longer happens. The changes mostly consist of re-formatting the code and improving readability. But most importantly, it now returns 1 if it can completely parse the string.

@a740g a740g added the bug Something isn't working label Jan 4, 2024
@a740g a740g self-assigned this Jan 4, 2024
@a740g a740g merged commit d040763 into QB64-Phoenix-Edition:main Jan 5, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants