Skip to content

Conversation

@lcheylus
Copy link
Contributor

On OpenBSD, at the end of file, pointer buf=0 after call of C.getline => tos function panic.

Add case for error when calling C.getline

Fix #26361


Tests OK on OpenBSD and Linux with V code sent from stdin

$ uname -mrs
OpenBSD 7.8 amd64
$ echo "println(2+5)" | ./v run -
7

$ uname -mrs
Linux 6.12.38+deb13-amd64 x86_64
$ echo "println(2+5)" | ./v run -
7

On OpenBSD, at the end of file, pointer buf=0 after call of C.getline
=> tos function panic.

Add case for error when calling C.getline

Signed-off-by: Laurent Cheylus <foxy@free.fr>
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.

v crash on OpenBSD with code sent from stdin

1 participant