]> gitweb.factorcode.org Git - factor.git/commitdiff
VM: we can save the process by throwing a normal error here
authorBjörn Lindqvist <bjourne@gmail.com>
Sat, 24 Jun 2017 23:43:31 +0000 (01:43 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Sat, 24 Jun 2017 23:43:31 +0000 (01:43 +0200)
core/io/streams/c/c-tests.factor
vm/io.cpp

index 2c69f6b19425067fcb8e942a40139429b2a23e20..010c6daf033a19a73b59b252ab97ac81fde12b40 100644 (file)
@@ -1,5 +1,5 @@
-USING: alien.c-types alien.data io io.encodings.ascii io.files
-io.pathnames io.streams.c kernel math specialized-arrays
+USING: alien alien.c-types alien.data debugger io io.encodings.ascii
+io.files io.pathnames io.streams.c kernel math specialized-arrays
 strings tools.test ;
 SPECIALIZED-ARRAY: int
 
@@ -33,3 +33,5 @@ SPECIALIZED-ARRAY: int
 
 ] with-test-directory
 
+
+[ 3 10 99 <alien> fseek ] [ vm-error? ] must-fail-with
index 4132e28b0b3327180da97efe6c3ce6d49494bba0..b58e4a8d5e2ea3bd76f7ec6ca17a7bd6b7171c76 100644 (file)
--- a/vm/io.cpp
+++ b/vm/io.cpp
@@ -132,7 +132,7 @@ void factor_vm::safe_fseek(FILE* stream, off_t offset, int whence) {
       whence = SEEK_END;
       break;
     default:
-      critical_error("Bad value for whence", whence);
+      general_error(ERROR_IO, tag_fixnum(EINVAL), false_object);
   }
 
   for (;;) {