From af65969c0b013ab16f24fee6ee1500274a9bcc47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Thu, 4 Aug 2016 14:51:43 +0200 Subject: [PATCH] file-stream-fd: don't cause internal error If the argument isn't a file-stream rise a SIMPLE-TYPE-ERROR condition. Fixes #271. --- CHANGELOG | 4 ++++ src/c/file.d | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d0a80933f..63fd88a38 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -57,6 +57,10 @@ appropraite documentation section (new-doc). Function was obfuscated with ifdefs with non-even pairs of =#\{= and =#\}=. ** Issues fixed +- ext:file-stream-fd +Doesn't cause an internal-error if fed with not a file-stream (signals a +SIMPLE-TYPE-ERROR condtition). + - stable-sort bugfix and improvement in speed Adapted from SBCL by Diogo Franco. diff --git a/src/c/file.d b/src/c/file.d index 7e9fd652e..fca767c34 100755 --- a/src/c/file.d +++ b/src/c/file.d @@ -4201,8 +4201,9 @@ si_file_stream_fd(cl_object s) { cl_object ret; - unlikely_if (!ECL_ANSI_STREAM_P(s)) - FEerror("file_stream_fd: not a stream", 0); + unlikely_if (!ECL_FILE_STREAM_P(s)) { + not_a_file_stream(s); + } switch ((enum ecl_smmode)s->stream.mode) { case ecl_smm_input: @@ -4218,7 +4219,7 @@ si_file_stream_fd(cl_object s) default: ecl_internal_error("not a file stream"); } - @(return ret);; + @(return ret); } /**********************************************************************