Commit graph

2746 commits

Author SHA1 Message Date
Daniel Kochmański
dd2e3903bc run-program: handle error' parameter value :output'
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-25 12:41:07 +02:00
Daniel Kochmański
788eaf041a run-program: Major function refactor
A lot of code was duplicated due to creating descriptors for output,
input and error streams. It is reduced by extracting function
`create_descriptor'.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-25 12:41:07 +02:00
Daniel Kochmański
623857e379 run-program: Export error stream symbol
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-25 12:41:07 +02:00
Daniel Kochmański
43b0781eb2 run-program: Implement stderr handling as stream and as pathname
This makes `stderr` same class citizen as `stdout` and `stdin`. In
order to make it work structure process has been changed to be able to
handle stream_error and index of `exit-code` and `status` are
1+. Access to stream is possible via last value of run-program, which
returns process itself.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-25 12:41:01 +02:00
Daniel Kochmański
db8fcb2436 run-program: fix order of if/else clauses (sanity patch)
Order of checking the same conditions in input and output was slighly
different without an obvious reason. Fixed that, so code is easier to
read.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-25 12:01:29 +02:00
Daniel Kochmański
8c73c415be stack: Protect user from resizing stack above maximum limit
If `rlimit' is available (ie on linux), then don't extend stack above
maximum value. If we don't know limit or limit is `infinity', then
there is no protection and user extends heap on his own risk.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-24 17:09:41 +02:00
Daniel Kochmański
5abfaad937 stacks.d: make `*_set_size' set size, not limit
Now `si:set-limit' calculates size by itself, while `*_set_size' sets
size as name says. Extend `c-stack' by magnitude of two.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-24 17:09:37 +02:00
Daniel Kochmański
202c35990a cosmetic: remove braces around single instruction
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-24 13:46:17 +02:00
Daniel Kochmański
09ae630cde stack: add special conditional handler for stack-overflow
Add `serror' and `stack-error-handler', which behave like normal
`cerror' -> `universal-error-handler' call order, except fact, that
after handling stack-overflow condition they reset appropriate stack
limit. Fixes #56.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-24 13:45:54 +02:00
Daniel Kochmański
44c58e95f7 stacks.d: introduce function `si_reset_margin'
When stack overflow condition is risen, to throw cerror stack limit
has to be raised by pre-allocated margin. This function resets stack
limit to original value. The only argument is stack designator.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-24 13:45:07 +02:00
Daniel Kochmański
f849b4a99a stack: add fields keeping stacks size limits
It is different from stack size, because limit is space available to
user, while stack size is larger by safe_area necessary to act on
stack overflow conditions.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-24 13:37:36 +02:00
Daniel Kochmański
c9ae722ffd stacks.d: make `*_set_size' functions behave consistant
Some functions were setting size of stack to provided value, while
other added (* 2 margin) to it, what wasn't consistant. Now each
function treats provided size as a limit and adds margin to it.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-22 19:03:20 +02:00
Daniel Kochmański
4d19a27424 cosmetic: untabify
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-21 14:38:20 +02:00
Daniel Kochmański
d305313d95 clos: Add nickname 'MOP' for CLOS package.
Documentation explicitly mentions this nickname, and it's common for
many implementations.  Closes #72.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-05-25 10:51:05 +02:00
Daniel Kochmański
294b2e785e format: copy sequence after producing output string.
This is required because format is working on string with fill pointer
making it an array - not simple-array what is expected.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-05-19 23:56:31 +02:00
Daniel Kochmański
c7e8144062 unicode: Fix builds without unicode support.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-05-12 11:18:12 +02:00
Daniel Kochmański
7599ca2967 unicode: fix typo in surrogate characters sanity check.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-05-06 22:35:57 +02:00
Daniel Kochmański
88b8ad015a pathname: Make type of pathname being (simple-array character (*)).
Removes coercion to base-string and improves some use cases. Due to
recent change in double-quote reader (conformity fix), now type of
each read string is (simple-array character (*)), so when pathnames
were created, it were copying it to (simple-array base-char (*)), lead
to buggy results. Consider:

(let ((path
       (let ((x "foo"))
	 (make-pathname :name x :type x))))
  (eql (pathname-name path)
       (pathname-type path))) ; => T

Before change, this construct was returning NIL, what in case of
serialization might be a problem, and wasn't `the right thing`® to do.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-05-03 11:52:08 +02:00
Daniel Kochmański
3938eb8893 unicode: Improve unicode handling for characters.
Additional sanity checks and bugfixes in case of providing extended
strings to character low-level functions.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-05-03 11:36:20 +02:00
Daniel Kochmański
8977a7cc85 unixfsys.d: enter-directory: Coerce if directory is extended string.
If directory is of type (simple-array character(*)), then coerce it to
(simple-array base-char (*)) instead of throwing an error.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-05-02 14:00:08 +02:00
Daniel Kochmański
9cacaacac2 Revert "symols_list2.h: build actualized this file after symbols_list.h"
This reverts commit 4ff5921d7c.
2015-04-24 16:15:27 +02:00
Daniel Kochmański
9f1f595b3d Revert "sombols-list: fix bogus entry for ext::make-encoding in symbols_list.h."
This reverts commit 518264369e.
2015-04-24 16:14:57 +02:00
Roger Sen
b0e78cad8d Removed external reference to GC_dont_gc, no needed in the new Boehm
GC API.
2015-04-12 11:47:50 +02:00
Roger Sen
cddb87313d Updated GC api to remove deprecated methods 2015-04-12 11:47:43 +02:00
Daniel Kochmański
4ff5921d7c symols_list2.h: build actualized this file after symbols_list.h 2015-03-07 18:25:33 +01:00
Daniel Kochmański
518264369e sombols-list: fix bogus entry for ext::make-encoding in symbols_list.h.
Due to mistake, ext::make-encoding was pointing to si_make_encoding,
but si_make_encoding was calling ext::make-encoding, what caused
infinite recursion when building for windows, when codepage was
different then Latin-1.
2015-03-06 17:10:43 +01:00
Daniel Kochmański
f499cf744f file.d: move variable declarations before body of functions.
This patch is necessary to compile ECL under MSVC (2008/2010) on
Windows platform.
2015-02-25 21:59:32 +01:00
Daniel Kochmański
25a4892635 Merge branch 'master' into develop 2015-02-21 19:52:01 +01:00
Nils Bruin
8a2d0c96e8 Patch to improve CLHS compliance of file-position
CLHS mandates that failure to determine or set the file position on a
stream should be signalled by returning NIL rather than raising an error.

Also, POSIX does not mandate that lseek fail on terminals, but these devices
obviously are not seekable. Hence, CLHS compliance is improved by explicitly
returning NIL when the requested stream is a tty.
2015-01-26 18:30:04 -08:00
Daniel Kochmanski
45ebde8b39 ffi: implement si_unload_foreign_module.
Patch is necessary to implement this function in cffi - a few libraries
depends on this functionality, and until now it throws an error.

Signed-off-by: Daniel Kochmanski <dkochmanski@hellsgate.pl>
2015-01-18 13:57:20 +01:00
Arto Bendiken
03e4303ff8 Imported a model file for Coverity Scan to reduce false positives.
In general, any function declared with the 'ecl_attr_noreturn'
attribute might need to be defined to call __coverity_panic__() here.

See: https://scan.coverity.com/tune
2014-10-15 13:59:04 +00:00
Arto Bendiken
ba3d8d907d Corrected pathname buffer size handling in the dpp utility.
This resolves CID 66412 (Buffer not null terminated).
Note, however, that BUFSIZ should probably be PATH_MAX instead.
2014-10-14 22:13:59 +00:00
Arto Bendiken
e13c07bd4a Ensured that ecl_file_len() doesn't return a random value on error.
This partially addresses CID 66411 (Unchecked return value from library).
The call to fstat() should still probably have error checking added.
2014-10-14 22:04:30 +00:00
Arto Bendiken
8e714e3a55 Added a sanity check to the unreachable branch in expt_zero().
This resolves CID 66441 (Missing return statement).
2014-10-14 21:58:59 +00:00
Arto Bendiken
633c3a5f63 Added a sanity check assertion for VV in ecl_init_module().
This addresses CID 66852 (Uninitialized pointer read).
2014-10-14 20:27:59 +00:00
Stas Boukarev
85165d989a Fix eql-specializer dispatch caching.
When the EQL specializer is a class it may clash with a class
specializer, since the class specializer is cached as a class object.
Use twice as much space for cache, the cache entry itself and a bit, 1
if it's an eql-specializer, 0 if it's a class specializer.

Fixes #295
2014-09-27 00:46:50 +04:00
Daniel Kochmański
fa6a345055 c/Makefile.in: fixed multiple-job build of ecl.
make -jX was failing due to unresolved dependencies to dpp.

See: https://sourceforge.net/p/ecls/patches/37/
Signed-off-by: Arto Bendiken <arto@bendiken.net>
2014-09-22 12:40:37 +00:00
Philipp Marek
997412481c Add two "t_string" cases, as the reader now always returns STRINGs.
See http://article.gmane.org/gmane.lisp.ecl.general/10410 for a discussion.
2014-05-04 20:46:14 +02:00
Philipp Marek
34253898c7 Not only BASE-STRINGs but STRINGs may be package-specifiers, too.
Needed because quoted strings are read now always read as STRING.
2014-04-28 07:42:06 +02:00
Philipp Marek
4cb3d7c17b double_quote_reader(): Reference the discussion on ecls-list. 2014-04-27 10:54:30 +02:00
Philipp Marek
d2aa6f957e Trying to fix closure-common.
RUNEs and RODs are not compatible with the result
of (RUNES:RUNE), because that returns (STRING ...), and

  (TYPE-OF "Σ") has CHARACTERS, but
  (TYPE-OF "a") "only" BASE-CHARs ...

At least CLISP, ABCL, SBCL return the same value for both
TYPE-OF forms above.
2014-04-26 20:01:47 +02:00
Philipp Marek
77a267c7e4 Make (EXT:PACKAGE-LOCK) return the promised value.
The (possibly invalid!) pack.locked was returned; for STRING inputs
the field aliased to "elttype", which was eg. 0xf for t_base_strings.
2014-03-09 20:35:43 +01:00
Philipp Marek
e161690265 Fixed a typo. 2014-03-09 20:31:59 +01:00
Stas Boukarev
d4f3997bda Fix MULTIPLE-VALUE-BIND not evaluating values-form.
(let (x) (multiple-value-bind () (setf x t)) x) returned NIL because
the values-form was discarded.
2014-03-02 21:36:23 +01:00
Philipp Marek
3e9f5cafe1 Fix declaration that was activated by commit 285eb318,
"fixes for the detection of GC_start_call_back"
2014-02-27 20:47:53 +01:00
D Herring
285eb31812 fixes for the detection of GC_start_call_back
- HAVE_GC_SET_START_CALLBACK was defined unconditionally
- there was no AC_DEFINE if system_boehm was false
- there was a typo in one usage site of this macro

see 6b754564f1
2014-02-27 09:43:21 +01:00
Stas Boukarev
5c9a58723a Fix NO-APPLICABLE-METHOD.
Its lambda-list should be (generic-function &rest function-arguments), not
(generic-function function-arguments).

Its value should be returned at the call site of the generic function.

Fixes #278.
2014-02-23 09:48:55 +01:00
Philipp Marek
2929636a14 #276 [PATCH]: printing hashtables readably is broken
https://sourceforge.net/p/ecls/bugs/276/
Thanks, Stas.
2014-02-22 12:27:26 +01:00
Juanjo Garcia-Ripoll
237af2e803 _hash_equalp() did not contain a case for bignums. 2013-10-29 23:47:54 +01:00
Juanjo Garcia-Ripoll
3dd9b227bd Fixed typo 2013-10-15 09:57:25 +02:00