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

Basic tokeniser crashes last line isn't blank #30

Closed
davidgiven opened this issue May 26, 2018 · 7 comments
Closed

Basic tokeniser crashes last line isn't blank #30

davidgiven opened this issue May 26, 2018 · 7 comments
Labels

Comments

@davidgiven
Copy link

If you use PUTBASIC on a file where the last line doesn't end in a line feed, then beebasm seg faults.

...there's not really a lot more useful I can say; it seems completely reproducible!

This is with head of git as of writing.

@mungre
Copy link
Collaborator

mungre commented May 26, 2018

I created a really simple basic file with a dangling last line... and of course it worked fine.

Can you post an example?

@davidgiven
Copy link
Author

Huh.

...so it only seems to happen when outputting to an SSD. I attach a turnkey example, which I should totally have done in the first place --- sorry:

test.zip

Do:

beebasm -i test.asm -do test.ssd

...to run.

@mungre
Copy link
Collaborator

mungre commented May 26, 2018

That works fine too. I'm trying this on Windows, are you using something Unixy?

@mungre
Copy link
Collaborator

mungre commented May 26, 2018

I reproduced it in Windows 10's Ubuntu environment. There's a fix (I hope!) in the proposed-updates branch: https://github.com/stardot/beebasm/tree/proposed-updates

@davidgiven
Copy link
Author

Good to know --- belatedly, I'm on amd64 Debian.

@davidgiven
Copy link
Author

Incidentally, so it doesn't get lost; from #32:

Line 757 of BASIC.cpp, which eats whitespace, doesn't check for EOF, so if there are two blank lines at the end of the file it eats forever until it overruns the buffer and then crashes.

mungre added a commit that referenced this issue May 31, 2018
@mungre mungre added the bug label May 31, 2018
@mungre
Copy link
Collaborator

mungre commented May 31, 2018

Fixed in proposed-updates: 3ee1e6a

@mungre mungre closed this as completed May 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants