Commit graph

7140 commits

Author SHA1 Message Date
Fabrizio
261f41fb19 Merge branch 'fix-233-mvb-bug' into 'develop'
Fix 233 mvb bug

Closes #233

See merge request !77
2017-07-02 21:55:07 +00:00
Daniel Kochmański
243646104b cosmetic: remove unused macro 2017-07-02 23:12:12 +02:00
Daniel Kochmański
b1462dcb65 cosmetic: remove extra newline 2017-07-02 23:05:21 +02:00
Daniel Kochmański
c999b56ab5 tests: add regression test for #233. 2017-07-02 23:04:25 +02:00
Daniel Kochmański
cc332a6c3f tests: with-compiler: add todo 2017-07-02 23:03:43 +02:00
Daniel Kochmański
aeaa3017bc tests: fix multiple evaluation of forms 2017-07-02 23:03:29 +02:00
Daniel Kochmański
9735057bc3 stacks: don't call si_set_finalizer
si_set_finalizer is CL-world function and returns 0 values. That means
in particular, that env->nvalues is changed.

In this situation, when new binding was introduced, we could lose our
nvalues, what lead to invalid multiple-value-bind (next commit will
contain a regression test).

We use unprotected version. If interrupts cause problems with it, we
may need to wrap it in disable_interrupts. Threading code uses
ecl_set_finalizer_unprotected without such wrapping though, so I
believe that should be safe.

Fixes #233.
2017-07-02 22:35:37 +02:00
Daniel Kochmański
355d15db3a add legacy definition for FEprogram_error_noreturn 2017-07-01 12:57:15 +02:00
Daniel Kochmański
0828b1f48a equalp: don't compare clos instance slots
Problem identified and fixed by Marius Gerbershagen. Closes #391.
2017-06-30 20:19:51 +02:00
Daniel Kochmański
927178d2e4 cosmetic: add doc stub 2017-06-30 20:16:21 +02:00
Daniel Kochmański
69a14cc686 Merge branch 'develop' into 'develop'
Remove FEprogram_error_noreturn (+ a typo fix)

See merge request !76
2017-06-30 11:10:13 +00:00
Kris Katterjohn
91bf0c4998 Fix typo in error message: ist -> is 2017-06-29 17:29:18 -05:00
Kris Katterjohn
028ab410b2 Remove FEprogram_error_noreturn and replace uses with FEprogram_error
These two function are the same.

Here is my understanding: FEprogram_error_noreturn was introduced with
the noreturn function attribute in commit 7d9fb8bb because
FEprogram_error did not have this attribute.  However, FEprogram_error
got the noreturn function attribute in commit 790d466c.  Now there is
no reason to have both of these.

This removes FEprogram_error_noreturn and changes all calls to it
with calls to FEprogram_error instead.
2017-06-29 17:24:54 -05:00
Daniel Kochmański
8fd53c6470 Merge branch 'develop' into 'develop'
Inconsistent and missing checks in binding forms

See merge request !74
2017-06-29 10:16:27 +00:00
Daniel Kochmański
307345764d Merge branch 'develop' into 'develop'
Signal error on invalid constant type checking.

See merge request !75
2017-06-29 08:41:50 +00:00
Kris Katterjohn
643651e320 Move FEillegal_variable_name to error.d and use it where appropriate
This was local to compiler.d, but it should also be used in stacks.d.

This is used in place of the error message introduced in commit 9ff142.
2017-06-28 14:21:28 -05:00
Kris Katterjohn
f5b9430c6c Introduce FEbinding_a_constant and use it where appropriate
This is for signalling an error about binding a constant variable.

This makes the error messages originally in commits 745686, c9e732
and 4e3283 more precise.
2017-06-28 14:03:29 -05:00
Fabrizio Fabbri
6dc40c869c
Signal error on invalid constant type checking.
Side effet was SIGSEGV on compiled code.
2017-06-28 15:58:20 +02:00
Kris Katterjohn
9051af7e60 Rename a constant variable to prevent "make check" failures
Commit 745686 prevents LET from binding constant variables, but this
sometimes caused a problem during "make check".  The problem would
only happen sometimes, depending on the order in which the tests were
run.  cmp.0026.defconstant-warn defines a constant variable named
FOO and cmp.0015.setf-expander binds FOO using LET.  Now rename the
constant variable FOO to +FOO+.

"make check" runs fine
2017-06-27 19:31:52 -05:00
Kris Katterjohn
4e3283706f No longer allow PROGV to bind constants
PROGV was allowed to bind constants in the C-compiler and the bytecode
compiler and interpreter, but the behavior would differ between them:

> (defun foo ()
    (flet ((memq (item list) (member item list :test #'eq)))
      (progv (list :test) (list :test-not)
        (memq 'bar '(bar baz quux)))))
FOO

> (foo)
(BAZ QUUX)

> (compile 'foo)
FOO

> (foo)
(BAR BAZ QUUX)

CLHS says the behavior is undefined when attempting to bind or assign
constant variables (CLHS 3.1.2.1.1.3 and the entry for defconstant).

The C-compiler and bytecode compiler and interpreter give errors when
attempting to bind or assign constant variables in lambda expressions,
LET, SETQ and various other binding/assignment forms.  So the behavior
above in PROGV is inconsistent.

Now give an error when attempting to bind a constant variable in PROGV
in the C-compiler and the bytecode compiler and interpreter.
2017-06-27 18:46:55 -05:00
Kris Katterjohn
c9e7326275 No longer allow M-V-B to bind constants in bytecode compiler/interpreter
M-V-B was allowed to lexically and dynamically bind constants in the
bytecode compiler and interpreter:

> (multiple-value-bind (pi rem) (truncate pi) pi)
3

CLHS says the behavior is undefined when attempting to bind or assign
constant variables (CLHS 3.1.2.1.1.3 and the entry for defconstant).

The C-compiler gives errors for these sorts of things, and the bytecode
compiler and interpreter gives errors when attempting to bind or assign
constant variables in lambda expressions, LET, SETQ and various other
binding/assignment forms.  So the behavior above in M-V-B is
inconsistent with the C-compiler and other parts of the bytecode
compiler and interpreter.

Now give an error when attempting to bind a constant variable in M-V-B
in the bytecode compiler and interpreter.
2017-06-27 18:44:14 -05:00
Kris Katterjohn
74568641cd No longer allow LET/LET* to bind constants in bytecode compiler/interpreter
LET/LET* were allowed to lexically and dynamically bind constants in
the bytecode compiler and interpreter:

> (let ((pi 3)) pi)
3

> (progn (defconstant +c+ 'foo) (let ((+c+ 'bar)) +c+))
BAR

> (flet ((hello () (format t "hi")))
    (let ((t nil))
      (declare (special t))
      ; Oops, now this returns a string
      (hello)))
"hi"

Plus plenty of other ways to wreak havoc on unsuspecting code.

CLHS says the behavior is undefined when attempting to bind or assign
constant variables (CLHS 3.1.2.1.1.3 and the entry for defconstant).
(Well, CLHS 3.4.1 explicitly says that constant variables cannot be
used for variables in lambda lists.)

The C-compiler gives errors for these sorts of things, and the bytecode
compiler and interpreter gives errors when attempting to bind or assign
constant variables in lambda expressions, SETQ and various other forms.
So the behavior above in LET is inconsistent with both the C-compiler
and other parts of the bytecode compiler and interpreter.

Now give an error when attempting to bind a constant variable in
LET/LET* in the bytecode compiler and interpreter.

This also changes the behavior of PROG/PROG* and DESTRUCTURING-BIND so
that they give errors when attempting to bind constants as well.
2017-06-27 18:42:20 -05:00
Kris Katterjohn
9ff1420cf5 Check for a symbol before attempting to bind it in PROGV
PROGV was attempting to bind whatever was in its variable list
without checking its type.  Using either the C-compiler or bytecode
compiler/interpreter, the following example would lead to a segfault
on my OpenBSD and Linux boxes:

> (defun foo () (progv (list 3) (list 3)))
FOO

> (foo)
Condition of type: SEGMENTATION-VIOLATION
[...]

Now give an error when attempting to bind something that is not a
symbol in PROGV (in both the C-compiler and bytecode compiler and
interpreter).
2017-06-27 18:35:24 -05:00
Daniel Kochmański
c66fe1ea59 Merge branch 'develop' into 'develop'
Correctly set TCP_NODELAY in open-{client,server}-stream

See merge request !73
2017-06-26 06:16:49 +00:00
Kris Katterjohn
26e7802917 Stop depending on uninitialized variables when setting TCP_NODELAY
The contents of an uninitialized variable was used when setting the
TCP_NODELAY option for sockets created with open-client-stream and
open-server-stream, so this option would not be set when the value
of the variable happened to be 0 (which happened regularly on my
OpenBSD box).

Tested on OpenBSD and Linux.
2017-06-23 17:06:57 -05:00
Kris Katterjohn
0c5be44ad9 #include netinet/tcp.h so TCP_* will actually be defined
This header needs to be included so the TCP_* defines are available.
Sockets created with open-client-stream and open-server-stream would
try to set TCP_NODELAY if available, but they couldn't because this
was not defined.

Tested on OpenBSD and Linux.
2017-06-23 17:04:43 -05:00
Daniel Kochmański
bfc58c219e add missing function 2017-06-23 17:56:32 +02:00
Daniel Kochmański
a993853acb Merge branch 'develop' into 'develop'
Various fix

See merge request !72
2017-06-23 14:27:49 +00:00
Fabrizio Fabbri
fb249d9e1e
regenerate configure 2017-06-22 00:51:41 +02:00
Fabrizio Fabbri
aa23a0339f
Merge remote-tracking branch 'origin/develop' into develop 2017-06-22 00:47:10 +02:00
Fabrizio Fabbri
ed737d2050
Fix configure on solaris 2017-06-22 00:45:38 +02:00
Daniel Kochmański
96772b9c03 Merge branch 'develop' into 'develop'
adjust memory allocation functions in windows API ecl_get_commandline_args.

See merge request !71
2017-06-13 10:34:43 +00:00
Yuguo Zhang
52a232b2d1 adjust memory allocation functions in windows API ecl_get_commandline_args.
the caller and the callee maybe use difference compiler and settings.
2017-06-13 18:22:59 +08:00
Daniel Kochmański
040ec49138 Merge branch 'develop' into 'develop'
doc: fix typo

See merge request !70
2017-06-12 06:33:19 +00:00
Yuguo Zhang
c6e235b7f2 doc: fix typo 2017-06-12 13:18:51 +08:00
Fabrizio Fabbri
06f5697074
Fix additional coverity warnings. 2017-06-06 23:43:02 +02:00
Daniel Kochmański
da47ed7f5f Merge branch 'develop' into 'develop'
patch for windows ReadConsole bug

See merge request !69
2017-06-05 06:03:40 +00:00
Yuguo Zhang
39ccfeaec9 windows build system clean/tidy up
upgrad yasm version from 1.2.0 to 1.3.0
2017-06-05 12:53:11 +08:00
Yuguo Zhang
fb716b4291 windows build system clean/tidy up
upgrade yasm version from 1.2.0 to 1.3.0
2017-06-05 12:49:12 +08:00
Yuguo Zhang
296fea073e patch for windows ReadConsole bug 2017-06-05 10:29:23 +08:00
Daniel Kochmański
1d4e453075 Merge branch 'revert' into 'develop'
Reapply merge !65

See merge request !68
2017-06-03 11:14:40 +00:00
Fabrizio Fabbri
f5cba162c2
Merge remote-tracking branch 'origin/develop' into revert 2017-06-03 12:59:41 +02:00
Fabrizio Fabbri
2aad976b27
Merge commit 'd73cc501' into revert 2017-06-03 12:58:33 +02:00
Fabrizio Fabbri
390caa3e51
Revert "Revert "Merge branch 'develop' into 'develop'""
This reverts commit cf416f6fd4.
2017-06-03 12:57:17 +02:00
Fabrizio Fabbri
d73cc5013b
Coverity fix issue
Proper cleanup of vararg.
Fix buffer corruption on dpp.
2017-06-03 11:57:01 +02:00
Daniel Kochmanski
b6a4d4a851 defstruct: be more ansi conformant with :predicate
Closes #385.
2017-05-30 19:31:55 +02:00
Daniel Kochmanski
cf416f6fd4 Revert "Merge branch 'develop' into 'develop'"
This reverts commit b75802f122, reversing
changes made to 5e3ccb1955.
2017-05-26 14:38:52 +02:00
Daniel Kochmański
a095f6a4ee ecl_thread_internal_error: provide hint what may go wrong 2017-05-25 08:19:19 +02:00
Daniel Kochmański
3c4e1541e5 format: scale-exponent: fix denormalized long-float
Fix submitted by Marius Gerbershagen. Fixes 383.
2017-05-25 08:03:32 +02:00
Daniel Kochmański
7ef7116589 windows: thread_internal_error: call ExitThread 2017-05-25 07:57:05 +02:00