1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00
Commit graph

18441 commits

Author SHA1 Message Date
Andy Wingo
a58758e782 Fix fixpoint computation in compute-significant-bits
* module/language/cps/specialize-numbers.scm (preserve-eq?): New
  helper.
  (sigbits-union): Use the new helper.  Fixes bugs.gnu.org/38486.
  Thanks to Zack Marvel for the bug report and Matt Wette for tracking
  it down.
2020-03-23 14:46:53 +01:00
Andy Wingo
7839dc444b Revert "Fix build on platforms where the stack grows upwards."
This patch was only meant to apply to the 3.0 branch.
2020-03-13 17:28:43 +01:00
Ludovic Courtès
be64a3e6a8 Bump version for Guile 2.2.7.
* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
(LIBGUILE_INTERFACE_REVISION): Increment.
2020-03-07 19:01:59 +01:00
Ludovic Courtès
c7d6bc03e7 Update NEWS.
* NEWS: Update.
2020-03-07 18:46:45 +01:00
Andy Wingo
95116c9627 Bump user-visible copyright years to 2020
* module/ice-9/command-line.scm (version-etc):
* module/scripts/compile.scm (show-version): Bump to 2020.
2020-03-07 18:45:44 +01:00
Ludovic Courtès
3795049ce6 Actually run '00-repl-server.test'.
This is a followup to ddcab06f20.  Until
now the tests would always be marked as unresolved because TMPDIR was
removed before the client and server had been started.

* test-suite/tests/00-repl-server.test (call-with-repl-server): Remove
initial call to 'rmdir'.  Add calls to 'delete-file' and 'rmdir' in the
unwind handler.
2020-03-07 18:39:40 +01:00
John Paul Adrian Glaubitz
51a52cd6c6 Fix build on platforms where the stack grows upwards.
* libguile/continuations.c (scm_dynthrow): Fix missing mra
   parameter to grow_stack for SCM_STACK_GROWS_UP.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-02-12 10:35:39 +01:00
Ludovic Courtès
885484c97b Handle GMP allocations through libgc and remove bignum finalizers.
This significantly speeds up loads that create lots of bignums, like
(language cps slot-allocation) for files with many top-level
definitions.  Compiling such a file is typically 2.5 times faster.

See <https://lists.gnu.org/archive/html/guile-devel/2020-02/msg00023.html>.

* libguile/numbers.c (custom_gmp_malloc): Use
'scm_gc_malloc_pointerless' instead of 'scm_malloc'.
(custom_gmp_realloc): Use 'scm_gc_realloc'.
(custom_gmp_free): Remove call to 'free'.
(make_bignum): Use 'scm_gc_malloc' instead of 'scm_gc_malloc_pointerless'.
Call 'scm_i_set_finalizer' only when SCM_INSTALL_GMP_MEMORY_FUNCTIONS is
false.
2020-02-12 10:35:18 +01:00
Ludovic Courtès
f4b0c3a93f Remove duplicate procedure in slot-allocation.scm.
* module/language/cps/slot-allocation.scm (add-live-slot)
(kill-dead-slot, compute-slot): Move higher up in the file.
(compute-shuffles): Remove duplicate 'add-live-slot' procedure.
2020-02-12 10:34:02 +01:00
Ludovic Courtès
7dfd7b0743 texinfo: Properly render @acronym in plain text.
Fixes <https://bugs.gnu.org/37846>.
Reported by Christopher Baines <mail@cbaines.net>.

* module/texinfo/plain-text.scm (acronym): New procedure.
(tag-handlers): Change 'acro' handle to ACRONYM, and add 'acronym'
handler.
* test-suite/tests/texinfo.plain-text.test ("stexi->plain-text")
["acronym", "recursive acronym"]: New tests.
2020-02-12 10:33:07 +01:00
Ludovic Courtès
149d229e3c texinfo: Add '*line-width*' fluid to control line wrapping.
* module/texinfo/plain-text.scm (*line-width*): New variable.
(wrap*): Honor it.
* doc/ref/texinfo.texi (texinfo plain-text): Document it.
* test-suite/tests/texinfo.plain-text.test: New file.
* test-suite/Makefile.am (SCM_TESTS): Add it.
2020-02-12 10:33:02 +01:00
Daniel Llorens
f361584a15 Fix check for rl_get_keymap
This lets Guile build on OS X (tested on 10.14) with the system-provided
libreadline.

* acinclude.m4 (GUILE_READLINE): Check for rl_get_keymap_name instead of
  rl_get_keymap. The system provided libreadline is an alias to libedit,
  which has _keymap but not _keymap_name, and Guile uses both.
* guile-readline/readline.c: Adjust the include guard.
2020-02-12 10:32:12 +01:00
Rob Browning
9a11be136f 00-repl-server.test: don't use fixed path for socket
* test-suite/tests/00-repl-server.test (make-tempdir): Add.
(call-with-repl-server): Store socket in a make-tempdir dir.
2020-01-22 21:23:16 -06:00
Rob Browning
5d29564971 Respect thread local fluid defaults
Previously (fluid-ref (make-thread-local-fluid #t)) would return #f via
scm_fluid_ref because the internal scm_hashq_ref would return #f when
the fluid had not been set, and that was interpreted as an actual value
for the fluid.

Instead, just pass the fluid default as the default for the hash table
lookups so that we don't need a second step to determine if the fluid
was set.

Thanks to Andrew Gierth for tracking down the problem.
2020-01-12 22:04:55 +01:00
Andy Wingo
aa0bfa2f93 Fix peval bug that ignored excess args
* module/language/tree-il/peval.scm (peval): Fix arity check for type
  confusion (empty value of "rest" in this context was (), not #f).  The
  effect was that we'd silently allow extra arguments to inlined calls.
  Thanks to Christopher Lam for the report!  Fixes #38617.
* test-suite/tests/peval.test ("partial evaluation"): Add a test.
2020-01-12 21:05:19 +01:00
Ludovic Courtès
fb7b873afa web: Update comment regarding the 'tls-wrap' port wrapper.
* module/web/client.scm (tls-wrap): Update comment.
2020-01-03 15:44:54 +01:00
Ludovic Courtès
edf5aea7ac Fix non-deterministic crash in 'finalization_thread_proc'.
Fixes <https://bugs.gnu.org/37757>.
Reported by Jesse Gibbons <jgibbons2357@gmail.com>.

* libguile/finalizers.c (finalization_thread_proc): Do not enter the
"switch (data.byte)" condition when data.n <= 0.
2019-12-09 14:44:59 +01:00
Ludovic Courtès
659526d33b ports: 'scm_port_poll' honors "w" flags.
Fixes <https://bugs.gnu.org/36709>.
Reported by Mark H Weaver <mhw@netris.org>.

* libguile/ports.c (scm_port_poll): Replace second POLLIN by POLLOUT.
2019-11-18 15:14:56 +01:00
Ludovic Courtès
a69b567d97 build: Do not record LDFLAGS in .pc file.
Fixes <https://bugs.gnu.org/36339>.
Reported by Cyprien Nicolas <cyprien@nicolas.tf>.

* configure.ac (GUILE_LIBS): Remove $LDFLAGS.
2019-07-07 15:07:44 +02:00
Ludovic Courtès
85de8637cd Bump version for Guile 2.2.6.
* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
(LIBGUILE_INTERFACE_REVISION): Increment.
2019-06-30 22:02:01 +02:00
Ludovic Courtès
5f522e11ca Update NEWS.
* NEWS: Update.
2019-06-30 22:00:20 +02:00
Ludovic Courtès
80213804ad REPL server: Avoid deprecated '_IOFBF'.
* module/system/repl/server.scm (drain-input-and-close): Use 'block
instead of _IOFBF.
2019-06-30 21:42:31 +02:00
Ludovic Courtès
ab2fd70ef1 'strftime' and 'strptime' honor the locale encoding.
Fixes <https://bugs.gnu.org/35920>.
Reported by Christopher Lam <christopher.lck@gmail.com>.

* libguile/stime.c (scm_strftime): Use 'scm_to_locale_stringn' instead
of 'scm_to_utf8_stringn'.
(scm_strptime): Likewise, and use 'scm_string_length' instead of
'u8_strnlen'.
* test-suite/tests/time.test ("strftime")["strftime passes wide
characters"]: Wrap body in 'with-locale'.
["strftime fr_FR.utf8", "strftime fr_FR.iso88591"]: New tests.
("strptime")["strftime fr_FR.utf8", "strftime fr_FR.iso88591"]: New
tests.
2019-06-30 21:31:36 +02:00
Ludovic Courtès
63f54a7bc6 doc: Document optional parameter of 'stat'.
Fixes <https://bugs.gnu.org/34860>.
Reported by Tim Gesthuizen <tim.gesthuizen@yahoo.de>.

* doc/ref/posix.texi (File System): Document 'exception_on_error'
parameter of 'stat'.
2019-06-30 17:26:43 +02:00
Ludovic Courtès
a152a67d38 tests: Add (web server) test.
* test-suite/tests/web-server.test: New file.
* test-suite/Makefile.am (SCM_TESTS): Add it.
2019-06-30 17:20:54 +02:00
Ludovic Courtès
043ed2ae5b ports: Export 'current-load-port'.
This binding was forgotten when (ice-9 ports) was introduced in
44b3342c4d.  Thus it has always been
missing in Guile 2.2.

* module/ice-9/ports.scm: Export 'current-load-port'.
2019-06-30 16:31:30 +02:00
Mark H Weaver
e1225d013e Revert "web: Add support for HTTP header continuation lines."
Fixes <https://bugs.gnu.org/36350>.

This reverts commit 73cde5ed72.
2019-06-24 11:33:13 -04:00
Paul Morris
f2c11dc181 doc: Fix argument list in match-lambda docs
* doc/ref/match.texi: Fix argument list for match-lambda.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-06-24 15:24:33 +02:00
Arun Isaac
77c4f2f48d doc: Fix minor typo in the HTTP headers documentation.
* doc/ref/web.texi (HTTP Headers): Fix minor typo.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-06-24 15:24:23 +02:00
Ludovic Courtès
f4f9d177f0 Remove references to 'inet-ntoa' and 'inet-aton'.
These procedures were removed in Guile 2.2 by commit
fc7bd367ab (May 2011).

* libguile/socket.h (scm_inet_aton, scm_inet_ntoa): Remove.
* module/system/repl/server.scm (make-tcp-server-socket): Use
'inet-pton' instead of 'inet-aton'.
* doc/ref/web.texi (HTTP): Likewise in 'declare-header!' example.
* doc/ref/posix.texi (Network Address Conversion): Remove documentation
of 'inet-ntoa' and 'inet-aton'.
2019-06-24 15:10:13 +02:00
Ludovic Courtès
f4db000c60 Bump version for Guile 2.2.5.
* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
(LIBGUILE_INTERFACE_CURRENT): Increment.
(LIBGUILE_INTERFACE_AGE): Increment.
(LIBGUILE_INTERFACE_REVISION): Reset.
2019-06-20 11:43:54 +02:00
Ludovic Courtès
8cf7b06d24 Copy terminating zero in 'scm_cat_path'.
* libguile/script.c (scm_cat_path): Pass N + 1, not N, to 'strncat'.
Reported by GCC 9.1.0.
2019-06-20 11:43:54 +02:00
Ludovic Courtès
d59dc5fbf2 srfi-14: Fix possible buffer overrun in '%char-set-dump'.
* libguile/srfi-14.c (scm_sys_char_set_dump): Change array size from 9
to 11 as suggested by GCC 9.1.0.
2019-06-20 11:34:46 +02:00
Mark H Weaver
6263d0350b NEWS: Add information to remaining news items.
* NEWS: Update.
2019-06-18 22:23:26 -04:00
Mark H Weaver
4e5b31cd7a NEWS: Fix typo.
* NEWS: Fix typo.
2019-06-18 16:08:36 -04:00
Mark H Weaver
c10b6a3f34 NEWS: More tweaks.
* NEWS: Update.
2019-06-18 15:57:11 -04:00
Mark H Weaver
8e2919b952 NEWS: Add more details.
* NEWS: Update text.
2019-06-18 15:46:43 -04:00
Mark H Weaver
c5c9ec9b1b NEWS: Add more text.
* NEWS: Update.
2019-06-18 14:04:03 -04:00
Mark H Weaver
cbc37f296e NEWS: Add first draft of 2.2.5 changes.
* NEWS: Add draft updates.
2019-06-18 11:53:06 -04:00
Mark H Weaver
1acc40d532 THANKS: Christopher Allan Webber -> Christopher Lemmer Webber.
* THANKS: Update name and re-sort.
2019-06-18 10:57:53 -04:00
Mark H Weaver
b91e42091d Update THANKS.
* THANKS: Thank Christopher Allan Webber, Christopher Baines, and
Timothy Sample for contributions.  Thank Andrea Azzarone, Михаил
Бахтерев, Jonathan Brielmaier, Josh Datko, Massimiliano Gubinelli, Arun
Isaac, Shea Levy, Chris Marusich, Jan Smydke, Tom de Vries, Jeffrey
Walton, and Zefram for fixes.  Move Michael Talbot-Wilson and Michael
Tuexen to their proper place to fix the sorting.
2019-06-18 10:51:53 -04:00
Christopher Baines
4c1901b90f stexi->shtml: Add support for @i, @math, @tie and @dots.
* module/texinfo/html.scm (tag-replacements): Add support for @i
and @math.  The tags used come from the texinfo documentation.
(rules): Convert @tie and @dots to the appropriate HTML entities.
2019-06-18 10:05:55 -04:00
Mark H Weaver
78b261d376 Avoid regexp ranges in HTTP inter-protocol exploitation check.
* module/system/repl/server.scm (permissive-http-request-line?): Avoid
character ranges in regexp.
2019-06-18 08:59:47 -04:00
Mark H Weaver
73cde5ed72 web: Add support for HTTP header continuation lines.
* module/web/http.scm (spaces-and-tabs, space-or-tab?): New variables.
(read-header-line): After reading a header, if a space or tab follows,
read the continuation lines and join them.
* test-suite/tests/web-http.test: Add test.
2019-06-18 08:28:01 -04:00
Mark H Weaver
579dd2da44 Rename 'scm_c_make_char' to 'scm_i_make_char'.
* libguile/chars.c, libguile/chars.h, libguile/ports.c,
libguile/print.c, libguile/read.c, libguile/srfi-13.c,
libguile/strings.c, libguile/vm-engine.c: Rename 'scm_c_make_char' to
'scm_i_make_char'.
2019-06-18 07:30:54 -04:00
Mark H Weaver
2d49ffa588 Make 'get-bytevector-n!' suspendable.
* module/ice-9/suspendable-ports.scm (get-bytevector-n!): New procedure.
(get-bytevector-n): Rewrite in terms of 'get-bytevector-n!'.
(port-bindings): Add 'get-bytevector-n!'.
2019-06-18 05:15:07 -04:00
Mark H Weaver
2980b66f6f SRFI-19: Rename 'tai-epoch-in-jd' to 'utc-epoch-in-jd'.
* module/srfi/srfi-19.scm: Rename 'tai-epoch-in-jd' to
'utc-epoch-in-jd', to reflect its actual meaning and usage.
2019-06-18 05:15:07 -04:00
Mark H Weaver
a17b727963 fport_seek: Eliminate a fruitless use of 'off_t_or_off64_t'.
This is a followup to commit 91ba73b397.

* libguile/fports.c (fport_seek): Use 'lseek' instead of
'lseek_or_lseek64', and use 'scm_t_off' uniformly.  That's the type used
in the function signature, and there's no benefit to using a wider type
internally.  Remove the overflow check, which is no longer needed.
2019-06-18 03:35:36 -04:00
Mark H Weaver
2095033b42 Fix documentation of R6RS 'binary-port?' to reflect reality.
* doc/ref/r6rs.texi (rnrs io ports): Improve the descriptions of
'binary-port?' and 'textual-port?'.
* module/rnrs/io/ports.scm (binary-port?, textual-port?): Update the
docstrings.
2019-06-18 03:09:42 -04:00
Mark H Weaver
521f1ab470 open-process: Fix dup(2) and execvp(2) error handling.
Previously, in the case where OUT is 0, or ERR is 0 or 1,
e.g. when (current-error-port) points to STDOUT, the code in
'start_child' to relocate OUT/ERR out of the way to another file
descriptor had multiple bugs:

(1) It neglected to close the original file descriptor.

(2) It checked 'errno' without first checking the return value of
    dup(2).  This doesn't work because dup(2) leaves 'errno' unchanged
    if there's no error.

(3) In case 'errno' contained EINTR, the retry code failed because
    OUT (or ERR) was overwritten by the result of the previous failed
    dup(2) call.

This commit fixes these problems, as well as another problem with
'execvp' error reporting.

* libguile/posix.c (renumber_file_descriptor): New static helper
function.
(start_child): Use 'renumber_file_descriptor'.  If 'execvp' fails, write
the error message to file descriptor 2.  Previously, we wrote the error
message to ERR, which was the old file descriptor before being relocated
to 2.
2019-06-18 03:07:27 -04:00