VM: we can save the process by throwing a normal error here

modern-harvey2
Björn Lindqvist 2017-06-25 01:43:31 +02:00
parent abbf8f8f1f
commit 134a9fbcb4
2 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,5 @@
USING: alien.c-types alien.data io io.encodings.ascii io.files USING: alien alien.c-types alien.data debugger io io.encodings.ascii
io.pathnames io.streams.c kernel math specialized-arrays io.files io.pathnames io.streams.c kernel math specialized-arrays
strings tools.test ; strings tools.test ;
SPECIALIZED-ARRAY: int SPECIALIZED-ARRAY: int
@ -33,3 +33,5 @@ SPECIALIZED-ARRAY: int
] with-test-directory ] with-test-directory
[ 3 10 99 <alien> fseek ] [ vm-error? ] must-fail-with

View File

@ -132,7 +132,7 @@ void factor_vm::safe_fseek(FILE* stream, off_t offset, int whence) {
whence = SEEK_END; whence = SEEK_END;
break; break;
default: default:
critical_error("Bad value for whence", whence); general_error(ERROR_IO, tag_fixnum(EINVAL), false_object);
} }
for (;;) { for (;;) {