1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-03 13:20:26 +02:00
Commit graph

20154 commits

Author SHA1 Message Date
Jan Smydke
26b446d52b get-bytevector-n and get-bytevector-n! can now read more than 4 GB
* libguile/r6rs-ports.c (scm_get_bytevector_n, scm_get_bytevector_n_x):
Turn 'c_count' and related variables into a 'size_t', and use
'scm_to_size_t' instead of 'scm_to_uint'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-06-18 14:14:47 +02:00
Ludovic Courtès
efc33cd149 vm: Fix typo when checking for 'madvise' error code.
* libguile/vm.c (return_unused_stack_to_os): Check for EAGAIN, not -EAGAIN.
2018-06-18 14:14:47 +02:00
Ludovic Courtès
761cf0fb8c Make module autoloading thread-safe.
Fixes <https://bugs.gnu.org/31878>.

* module/ice-9/boot-9.scm (call-with-module-autoload-lock): New procedure.
(try-module-autoload): Wrap body in 'call-with-module-autoload-lock'.
* module/ice-9/threads.scm: Set (@ (guile) call-with-module-autoload-lock).
2018-06-18 14:14:47 +02:00
Ludovic Courtès
35f7df9378 tests: Add SRFI-71 test.
* test-suite/tests/srfi-71.test: New file.
* test-suite/Makefile.am (SCM_TESTS): Add it.
2018-06-18 14:14:47 +02:00
Christopher Allan Webber
eb90831ce8 Add SRFI 71: Extended LET-syntax for multiple values.
* module/srfi/srfi-71.scm: New file.
* module/srfi/Makefile.am: Add it.
* doc/ref/srfi-modules.texi: Document it.
* NEWS: Update.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-06-18 14:14:47 +02:00
Andy Wingo
460552163e Remove list.h from _scm.h
* libguile/_scm.h: Remove list.h include.  Add appropriate includes to
  relevant callers.
2018-06-18 11:46:32 +02:00
Andy Wingo
69990c4532 Deprecate libguile/validate.h
* libguile/validate.h: Replace contents with a #warning.
2018-06-18 10:50:23 +02:00
Andy Wingo
5f50309448 Remove includes of validate.h.
* guile-readline/readline.c:
* libguile/alist.c:
* libguile/array-map.c:
* libguile/arrays.c:
* libguile/async.c:
* libguile/atomic.c:
* libguile/backtrace.c:
* libguile/boolean.c:
* libguile/bytevectors.c:
* libguile/chars.c:
* libguile/continuations.c:
* libguile/debug.c:
* libguile/dynl.c:
* libguile/eq.c:
* libguile/error.c:
* libguile/eval.c:
* libguile/evalext.c:
* libguile/expand.c:
* libguile/feature.c:
* libguile/filesys.c:
* libguile/fluids.c:
* libguile/fports.c:
* libguile/gc-malloc.c:
* libguile/gc.c:
* libguile/goops.c:
* libguile/goops.h:
* libguile/guardians.c:
* libguile/hash.c:
* libguile/hashtab.c:
* libguile/hashtab.h:
* libguile/hooks.c:
* libguile/i18n.c:
* libguile/ioext.c:
* libguile/keywords.c:
* libguile/list.c:
* libguile/load.c:
* libguile/macros.c:
* libguile/memoize.c:
* libguile/modules.h:
* libguile/net_db.c:
* libguile/numbers.c:
* libguile/pairs.c:
* libguile/poll.c:
* libguile/ports.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/procprop.c:
* libguile/procs.c:
* libguile/promises.c:
* libguile/r6rs-ports.c:
* libguile/random.c:
* libguile/rdelim.c:
* libguile/read.c:
* libguile/regex-posix.c:
* libguile/rw.c:
* libguile/scmsigs.c:
* libguile/script.c:
* libguile/simpos.c:
* libguile/socket.c:
* libguile/sort.c:
* libguile/srcprop.c:
* libguile/srfi-1.c:
* libguile/srfi-4.c:
* libguile/srfi-60.c:
* libguile/stacks.c:
* libguile/stime.c:
* libguile/strings.c:
* libguile/strorder.c:
* libguile/strports.c:
* libguile/struct.c:
* libguile/symbols.c:
* libguile/syntax.c:
* libguile/threads.c:
* libguile/throw.c:
* libguile/trees.c:
* libguile/unicode.c:
* libguile/values.c:
* libguile/variable.c:
* libguile/vectors.c:
* libguile/vports.c:
* libguile/weak-set.c:
* libguile/weak-table.c:
* libguile/weak-vector.c:
* libguile.h: Remove validate.h include.
2018-06-18 10:50:23 +02:00
Andy Wingo
6f294ecc75 Devolve more validate macros
* libguile.h: Add chooks.h.
* libguile/Makefile.am: Add chooks.h and chooks.c.
* libguile/chooks.c:
* libguile/chooks.h: New files, for the C implementation of hooks.
  Broken out to avoid cycles in gc.h includes.
* libguile/gc.h:
* libguile/gc.c (scm_i_gc_admin_mutex, scm_i_sweep_mutex): Remove unused
  mutexes.  Include chooks instead of hooks in the main header.
* libguile/deprecated.h (scm_gc_running_p): Deprecate this macro always
  defined to 0.
  (SCM_VALIDATE_VECTOR_OR_DVECTOR): Deprecate this weird one too.
* libguile/array-map.c: Add procs.h include.
* libguile/threads.h:
* libguile/vm.c:
* libguile/r6rs-ports.c: Add smob.h include.
* libguile/atomic.h (SCM_VALIDATE_ATOMIC_BOX): Devolve.
* libguile/deprecation.c (scm_c_issue_deprecation_warning): Remove use
  of scm_gc_running_p.
* libguile/error.c (scm_error_scm): Remove use of scm_gc_running_p.
* libguile/filesys.h (SCM_VALIDATE_DIR)
* libguile/fluids.h (SCM_VALIDATE_FLUID)
* libguile/fports.h (SCM_VALIDATE_FPORT, SCM_VALIDATE_OPFPORT)
* libguile/generalized-arrays.h (SCM_VALIDATE_ARRAY)
* libguile/hooks.h (SCM_VALIDATE_HOOK)
* libguile/keywords.h (SCM_VALIDATE_KEYWORD)
* libguile/ports.h (SCM_VALIDATE_PORT, SCM_VALIDATE_INPUT_PORT)
  (SCM_VALIDATE_OUTPUT_PORT, SCM_VALIDATE_OPINPORT)
  (SCM_VALIDATE_OPENPORT, SCM_VALIDATE_OPPORT, SCM_VALIDATE_OPOUTPORT)
* libguile/procs.h (SCM_VALIDATE_PROC)
* libguile/random.h (SCM_VALIDATE_RSTATE)
* libguile/regex-posix.h (SCM_VALIDATE_RGXP)
* libguile/stacks.h (SCM_VALIDATE_STACK, SCM_VALIDATE_FRAME)
* libguile/strports.h (SCM_VALIDATE_OPOUTSTRPORT)
* libguile/struct.h (SCM_VALIDATE_STRUCT SCM_VALIDATE_VTABLE)
* libguile/symbols.h (SCM_VALIDATE_SYMBOL)
* libguile/variable.h (SCM_VALIDATE_VARIABLE)
* libguile/vectors.h (SCM_VALIDATE_VECTOR SCM_VALIDATE_VECTOR_LEN):
  Devolve.
* libguile/validate.h: It's empty now!

hooks squish
2018-06-18 10:50:17 +02:00
Andy Wingo
8a6f46ee96 More validate.h devolution
* libguile/validate.h:
* libguile/alist.h (SCM_VALIDATE_ALISTCELL, SCM_VALIDATE_ALISTCELL_COPYSCM)
* libguile/bytevectors.h (SCM_VALIDATE_BYTEVECTOR)
* libguile/chars.h (SCM_VALIDATE_CHAR, SCM_VALIDATE_CHAR_COPY):
* libguile/print.h (SCM_VALIDATE_OPORT_VALUE, SCM_VALIDATE_PRINTSTATE):
* libguile/procs.h (SCM_VALIDATE_THUNK)
* libguile/smob.h (SCM_VALIDATE_SMOB)
* libguile/strings.h (SCM_VALIDATE_STRING): Devolve these macros from
  validate.h.
2018-06-18 09:44:35 +02:00
Andy Wingo
be18b50773 Move pair, null, nil, and boolean validators out of validate.h
* libguile/validate.h:
* libguile/boolean.h (SCM_VALIDATE_BOOL, SCM_VALIDATE_BOOL_COPY):
* libguile/pairs.h (SCM_VALIDATE_NULL, SCM_VALIDATE_NULL_OR_NIL):
  (SCM_VALIDATE_CONS, SCM_VALIDATE_MUTABLE_PAIR)
  (SCM_VALIDATE_NULLORCONS): Move these macros.
2018-06-17 22:49:59 +02:00
Andy Wingo
eb5e1b8d5f Remove public SCM_VALIDATE_NIM
* libguile/random.c (scm_random): Remove needless use of
  SCM_VALIDATE_NIM.
* libguile/srcprop.c (SCM_VALIDATE_NIM): Move definition here, as this
  file is its only use.
* libguile/validate.h (SCM_VALIDATE_NIM): Remove.  This was public but
  unlikely to be used in the wild.
2018-06-17 22:42:20 +02:00
Andy Wingo
82d5662887 Move list validators to list.h
* libguile/validate.h:
* libguile/list.h (SCM_VALIDATE_REST_ARGUMENT, SCM_VALIDATE_LIST)
  SCM_VALIDATE_NONEMPTYLIST, SCM_VALIDATE_LIST_COPYLEN)
  SCM_VALIDATE_NONEMPTYLIST_COPYLEN): Move here from validate.h.
2018-06-17 22:39:32 +02:00
Andy Wingo
cd292b3bd9 Remove unused macros
* libguile/validate.h (SCM_MUST_MALLOC_TYPE, SCM_MUST_MALLOC_TYPE_NUM)
  (SCM_MUST_MALLOC): Remove unused macros.  scm_must_malloc was removed
  in Guile 2.0.
2018-06-17 22:35:03 +02:00
Andy Wingo
bdd66fdd24 Move more number validators to numbers.h.
* libguile/validate.h:
* libguile/numbers.h (SCM_OUT_OF_RANGE, SCM_ASSERT_RANGE)
  SCM_VALIDATE_REAL, SCM_VALIDATE_NUMBER, SCM_VALIDATE_USHORT_COPY)
  SCM_VALIDATE_SHORT_COPY, SCM_VALIDATE_UINT_COPY)
  SCM_VALIDATE_INT_COPY, SCM_VALIDATE_ULONG_COPY)
  SCM_VALIDATE_LONG_COPY, SCM_VALIDATE_SIZE_COPY)
  SCM_VALIDATE_FLOAT_COPY, SCM_VALIDATE_DOUBLE_COPY)
  SCM_VALIDATE_DOUBLE_DEF_COPY): Move here, from validate.h.
2018-06-17 22:32:08 +02:00
Andy Wingo
d10c3aa3cd Move number validators to numbers.h.
* libguile/validate.h:
* libguile/numbers.h (SCM_NUM2SIZE, SCM_NUM2SIZE_DEF, SCM_NUM2PTRDIFF)
  SCM_NUM2PTRDIFF_DEF, SCM_NUM2SHORT, SCM_NUM2SHORT_DEF, SCM_NUM2USHORT)
  SCM_NUM2USHORT_DEF, SCM_NUM2INT, SCM_NUM2INT_DEF, SCM_NUM2UINT)
  SCM_NUM2UINT_DEF, SCM_NUM2ULONG, SCM_NUM2ULONG_DEF, SCM_NUM2LONG)
  SCM_NUM2LONG_DEF, SCM_NUM2LONG_LONG, SCM_NUM2LONG_LONG_DEF)
  SCM_NUM2ULONG_LONG, SCM_NUM2ULONG_LONG_DEF, SCM_NUM2FLOAT)
  SCM_NUM2DOUBLE): Move these here, from validate.h.
2018-06-17 22:28:13 +02:00
Andy Wingo
87896eb3e6 Move core validate macros to error.h
* libguile/error.h (SCM_MAKE_VALIDATE, (SCM_I_MAKE_VALIDATE_MSG2)
  (SCM_MAKE_VALIDATE_MSG, SCM_SYSERROR, SCM_MEMORY_ERROR)
  (SCM_SYSERROR_MSG, SCM_MISC_ERROR, SCM_WRONG_NUM_ARGS)
  (SCM_WRONG_TYPE_ARG): Move here, from validate.h.
* libguile/validate.h: Include error.h.
2018-06-17 22:24:12 +02:00
Andy Wingo
f5cc012783 Remove _scm.h print.h include
* libguile/_scm.h: Remove unneeded print.h include.
2018-06-17 22:08:35 +02:00
Andy Wingo
03c6485eea Remove error.h include from _scm.h.
* libguile/pairs.h: Add missing error.h include.
* libguile/_scm.h: Remove error.h include.
2018-06-17 22:07:03 +02:00
Andy Wingo
08fd826d0c Require C99 to build Guile
* configure.ac: Refactor check to require C99, not just try to get C99.
2018-06-17 21:54:59 +02:00
Andy Wingo
63e5eafd83 Assume that if we have GCC, we have GCC >= 3.0.
* libguile/__scm.h (SCM_GNUC_PREREQ): Remove this definition.  Assume
  that if we have GCC, that we have GCC >= 3.0 (from 2002).  Adapt uses
  to use simply "#ifdef __GNUC__".
* libguile/deprecated.h (SCM_GNUC_PREREQ): Add deprecated definition.
2018-06-17 20:34:05 +02:00
Andy Wingo
e48567fa6c Remove alignof.h inclusion from _scm.h
* libguile/_scm.h: Remove unneeded alignof.h inclusion.
2018-06-17 19:50:43 +02:00
Andy Wingo
cd8c1f7e5d Remove _scm.h verify.h inclusion
* libguile/_scm.h: Remove unneeded verify.h inclusion.
2018-06-17 19:49:15 +02:00
Andy Wingo
68d9780ce4 Remove errno.h include from _scm.h.
* libguile/_scm.h: Remove errno.h include.
* libguile/bytevectors.c:
* libguile/debug.c:
* libguile/finalizers.c:
* libguile/loader.c:
* libguile/poll.c:
* libguile/strings.c:
* libguile/threads.c:
* libguile/vm.c: Add errno.h include.  Sort includes as needed.
2018-06-17 19:46:33 +02:00
Andy Wingo
5c511be7b6 Remove _scm.h inclusion of config.h
* libguile/_scm.h: Remove inclusion of config.h.  All includers already
  include config.h.
* libguile/syscalls.h: Remove config.h inclusion here too.
2018-06-17 19:46:14 +02:00
Andy Wingo
7b4ab0895b Inline definition of SIZEOF_SCM_T_BITS
* libguile/_scm.h (SIZEOF_SCM_T_BITS): Remove definition.
* libguile/conv-integer.i.c (SCM_TO_TYPE_PROTO, SCM_FROM_TYPE_PROTO):
* libguile/conv-uinteger.i.c (SCM_FROM_TYPE_PROTO):
* libguile/gc.c (DEFAULT_INITIAL_HEAP_SIZE):
* libguile/hashtab.c:
* libguile/loader.c:
* libguile/socket.c:
* libguile/vm-engine.c (VM_NAME): Use SIZEOF_UINTPTR_T instead of
  SIZEOF_SCM_T_BITS.
2018-06-17 19:21:42 +02:00
Andy Wingo
ea3c5cf909 Refactor regarding internal detection of ia64
* libguile/_scm.h: Remove hack to define __ia64__.
* libguile/continuations.c (capture_auxiliary_stack): Use __ia64 or
  __ia64__ to detect itanium.
2018-06-17 19:16:14 +02:00
Andy Wingo
ba26559795 Remove _scm hack to undefine HAVE_STRUCT_TIMESPEC
* libguile/_scm.h (HAVE_STRUCT_TIMESPEC): Remove hack to undefine this
  variable, which is never defined in Guile's build.
2018-06-17 19:14:38 +02:00
Andy Wingo
5159a15306 More _scm.h refactoring
* libguile/foreign.c (ROUND_UP): Copy here.
* libguile/vm.c (SCM_NOINLINE): Move here, to the only file that uses
  it.
  (ROUND_UP): Copy here.
* libguile/_scm.h (ROUND_UP, SCM_NOINLINE): Remove.  Centralizing
  private definitions isn't bad, but _scm.h also includes a bunch of
  Guile API as well, and the include itself is poorly named.
2018-06-17 19:10:52 +02:00
Andy Wingo
5176db70ca Move syscall-related private defines to their own header
* libguile/syscalls.h: New private header.
* libguile/Makefile.am
  (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): Add syscalls.h.
* libguile/_scm.h: Remove SCM_SYSCALL and all the bits relating to
  e.g. stat versus stat64.
* libguile/filesys.c:
* libguile/fports.c:
* libguile/i18n.c:
* libguile/ioext.c:
* libguile/poll.c:
* libguile/ports.c:
* libguile/posix.c:
* libguile/rw.c:
* libguile/scmsigs.c:
* libguile/script.c:
* libguile/socket.c:
* libguile/strports.c: Include syscalls.h.
2018-06-17 18:18:26 +02:00
Andy Wingo
f84ce5442e Refactor handling of auxiliary stacks and setjmp/longjmp
* libguile/__scm.h (scm_i_jmp_buf): Remove definition, which was a shim
  for ia64.  Instead, always use setjmp/longjmp and jmp_buf.
* libguile/_scm.h (SCM_I_SETJMP, SCM_I_LONGJMP): Remove; instead use
  setjmp and longjmp.
* libguile/continuations.c (capture_auxiliary_stack):
  (restore_auxiliary_stack): New helpers.
  (scm_i_make_continuation): Use capture_auxiliary_stack.
  (copy_stack_and_call): Use restore_auxiliary_stack.  No need to stash
  the aux stack on the thread, either.
* libguile/continuations.h (scm_t_contregs): Use
  SCM_HAVE_AUXILIARY_STACK to flag when to have an auxiliary_stack
  member.
* libguile/control.h:
* libguile/control.c (reify_partial_continuation, scm_c_abort):
  (scm_suspendable_continuation_p): Adapt to use setjmp/longjmp
  directly.
* libguile/deprecated.h: Add deprecated scm_i_jmp_buf define.
* libguile/dynstack.h:
* libguile/dynstack.c (PROMPT_JMPBUF):
  (scm_dynstack_push_prompt, scm_dynstack_find_prompt):
  (scm_dynstack_wind_prompt): Adapt to jmp_buf type.
* libguile/eval.c (eval): Use jmp_buf and setjmp directly.
* libguile/gc-malloc.c: No need for ia64-specific things.
* libguile/gc.c: No need for ia64-specific things.
* libguile/gc.h: No need to declare scm_ia64_ar_bsp.
* libguile/init.c: Remove typedef of setjmp_type for Cray, unused.
* libguile/threads.c (guilify_self_1): No more pending_rbs_continuation
  in scm_i_thread, and register_backing_store_base is handled by libgc.
  (scm_ia64_ar_bsp): Remove definitions; inlined into continuations.c's
  capture_auxiliary_stack.
* libguile/threads.h (scm_i_thread): jmpbuf member is plain jmp_buf.
* libguile/throw.c (catch): Just use jmp_buf and setjmp.
* libguile/vm-engine.c (VM_NAME): Adapt prototype to take jmp_buf
  pointer.
* libguile/vm.c (vm_abort): Adapt jmp_buf types.
  (scm_call_n): Use setjmp.
2018-06-17 13:41:03 +02:00
Andy Wingo
574f67d1b6 Add configure check for auxiliary stacks
* configure.ac: Add a check for struct GC_stack_base.reg_base, which is
  a proxy for checking for the only aspect of ia64 that we care about.
* libguile/gen-scmconfig.c:
* libguile/gen-scmconfig.h.in: Arrange to define
  SCM_HAVE_AUXILIARY_STACK.
2018-06-17 13:41:03 +02:00
Andy Wingo
b2515e65bd Remove unused getters for register backing store base
* libguile/gc.h:
* libguile/threads.c: Remove unused implementations of
  scm_ia64_register_backing_store_base, as libgc does this for us.
2018-06-17 13:41:03 +02:00
Andy Wingo
418a7d7af9 Remove #ifdef cases for VMS and Cray.
* libguile/__scm.h:
* libguile/_scm.h:
* libguile/feature.c (scm_init_feature): Remove VMS and Cray cases.
2018-06-17 13:41:03 +02:00
Andy Wingo
f6ec873a8b Move "min" and "max" macros out of _scm.h
* libguile/_scm.h: Remove definitions of min and max macros.
* libguile/array-map.c (MAX):
* libguile/foreign.c (MAX):
* libguile/numbers.c (MIN):
* libguile/quicksort.i.c (MIN):
* libguile/socket.c (MAX):
* libguile/strports.c (MAX): Inline definitions into callers.  We're
  going to remove _scm.h, which will pay off this duplication.
2018-06-17 13:41:03 +02:00
Andy Wingo
2f39771c84 Simplify definition of SCM_SYSCALL.
* libguile/_scm.h (SCM_SYSCALL): Simplify definition.
2018-06-17 13:41:03 +02:00
Andy Wingo
791341bdd2 Move some definitions out of _scm.h
* libguile/_scm.h:
* libguile/loader.h (SCM_OBJCODE_ENDIANNESS):
  (SCM_OBJCODE_WORD_SIZE, SCM_OBJCODE_MAJOR_VERSION):
  (SCM_OBJCODE_MINOR_VERSION, SCM_OBJCODE_MAJOR_VERSION_STRING):
  (SCM_OBJCODE_MINOR_VERSION_STRING):
  (SCM_OBJCODE_VERSION_STRING, SCM_OBJCODE_MACHINE_VERSION_STRING): Move
  definitions to loader.h.
2018-06-17 13:41:03 +02:00
Andy Wingo
83584ef231 Fix libguile subcomponent headers not to include <libguile.h>
* libguile/bytevectors.h: Include uniform.h, for use in the macros.
* libguile/extensions.h: Include libpath.h, for the
  SCM_EFFECTIVE_VERSION, which is almost always used with these
  routines.
* libguile/frames.h:
* libguile/instructions.h:
* libguile/intrinsics.h:
* libguile/loader.h:
* libguile/programs.h:
* libguile/vm.h: Include <libguile/__scm.h> instead of <libguile.h>.
  Cuts a circular include, but also precipitates a lot of maintenance in
  the .c files.

* libguile/*.c: Update C files to add needed all needed includes that
  before were getting automatically pulled in by the indirect inclusion
  of libguile.h.
2018-06-14 22:20:47 +02:00
Andy Wingo
ceaf782770 Call out to expand_stack through new VM intrinsic
* libguile/intrinsics.h (scm_t_vp_sp_intrinsic): New type.
  (SCM_FOR_ALL_VM_INTRINSICS): Add expand-stack.
* libguile/vm-engine.c (ALLOC_FRAME): Call through the intrinsics.
* libguile/vm.c (scm_bootstrap_vm): Initialize the expand-stack
  intrinsic.
2018-06-11 21:27:37 +02:00
Andy Wingo
3b463516ef Remove unused vm_error_unbound
* libguile/vm.c: Remove unused function.
2018-06-11 21:21:30 +02:00
Mark H Weaver
ac9f0831c1
Add copyright header for (language elisp falias), and fix typo.
* module/language/elisp/falias.scm: Add copyright header.
* module/language/elisp/spec.scm: Fix typo in header.
2018-06-11 10:14:28 -04:00
Mark H Weaver
bff75635e5
elisp: Fix cross-compilation support.
* module/system/base/target.scm (with-native-target): New exported
procedure.
* module/language/elisp/spec.scm: In the top-level body expression, call
'compile-and-load' within 'with-native-target' to compile native code.
* module/language/elisp/compile-tree-il.scm
(eval-when-compile, defmacro): Compile native code.
2018-06-11 10:12:54 -04:00
Mark H Weaver
9fbb367256
Fix error reporting in 'load-thunk-from-memory'.
Previously 'load-thunk-from-memory' would often throw to 'system-error'
based on a stale value in 'errno', leading to incorrect error messages.

* libguile/loader.c (load_thunk_from_memory): Set 'errno' to 0 before
jumping to cleanup in the ABORT preprocessor macro, and also in the case
when 'process_dynamic_segment' reports an error.
2018-06-11 10:12:52 -04:00
Mark H Weaver
ff2adb04cb
goops: Fix 'instance?' to work on objects that aren't structs.
Fixes <https://bugs.gnu.org/31606>
Reported by Tommi Höynälänmaa <tommi.hoynalanmaa@gmail.com>

* module/oop/goops.scm (instance?): Check that OBJ is a struct
before applying 'struct-vtable' to it.
2018-06-11 10:12:50 -04:00
Mark H Weaver
e1dffd3504
Avoid inexact arithmetic in the type inferrer for 'sqrt'.
* module/language/cps/types.scm: Use 'exact-integer-sqrt' and avoid
inexact arithmetic in the range analysis of the type inferrer for
'sqrt'.
2018-06-11 10:12:47 -04:00
Mark H Weaver
2733e97395
Fix type inference for bitwise logical operators.
Fixes <https://bugs.gnu.org/31474> and related bugs.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

* module/language/cps/types.scm (next-power-of-two): Remove procedure.
(non-negative?, lognot*, saturate+, saturate-, logand-bounds)
(logsub-bounds, logior-bounds, logxor-bounds): New procedures.  Use them
to improve and fix bugs in the range analysis of the type inferrers for
'logand', 'logsub', 'logior', 'ulogior', 'logxor', 'ulogxor', and
'lognot'.
2018-06-11 10:12:45 -04:00
Mark H Weaver
df93752479
Revert "Minor CSE run-time optimization"
Fixes <https://bugs.gnu.org/30020>.
Reported by David Thompson <dthompson2@worcester.edu>.

This reverts commit d4883307ca.
2018-06-11 10:12:43 -04:00
Mark H Weaver
1951edff58
Fix typo in comment within numbers.c 2018-06-11 10:12:35 -04:00
Andy Wingo
dbe5a7edc6 Remove unused macro in vm-engine
* libguile/vm-engine.c (VARIABLE_BOUNDP): Remove.
2018-05-14 16:55:30 +02:00
Andy Wingo
601d0eaf83 Remove implementations of now-unused toplevel-box et al instructions
* libguile/vm-engine.c (resolve, define!, toplevel-box, module-box):
  Remove implementations.
2018-05-14 16:46:22 +02:00