1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

* test-suite/tests/chars.test: Added test, attempting to apply a

character.  This test will only pass if the other changes that are
	submitted together with this patch are also applied.

	* libguile/tags.h: Fixed comment about the immediate type code
	layout.

	* libguile/eval.c: Fixed handling of non-special instructions.
	Without this patch, guile will segfault on (#\0) and similar
	instructions.
This commit is contained in:
Dirk Herrmann 2003-06-04 23:22:54 +00:00
parent 18f7ef3859
commit 47dbd81e77
5 changed files with 40 additions and 11 deletions

View file

@ -1,3 +1,10 @@
2003-06-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
* tags.h: Fixed comment about the immediate type code layout.
* eval.c: Fixed handling of non-special instructions. Without
this patch, guile will segfault on (#\0) and similar instructions.
2003-06-05 Kevin Ryde <user42@zip.com.au>
* numbers.c (scm_max, scm_min): For inum, bignum and real, if other

View file

@ -2448,6 +2448,9 @@ dispatch:
/* new syntactic forms go here. */
case SCM_BIT7 (SCM_MAKISYM (0)):
proc = SCM_CAR (x);
if (!SCM_IFLAGP (proc))
goto evapply;
switch (SCM_ISYMNUM (proc))
{

View file

@ -3,7 +3,7 @@
#ifndef SCM_TAGS_H
#define SCM_TAGS_H
/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002 Free Software Foundation, Inc.
/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -156,7 +156,7 @@ typedef unsigned long scm_t_bits;
* 0011-100 short instruction
* 0100-100 short instruction
* 0101-100 short instruction
* 0110-100 various immediates and long instructions
* 0110-100 short instruction
* 0111-100 short instruction
* 1000-100 short instruction
* 1001-100 short instruction
@ -164,13 +164,14 @@ typedef unsigned long scm_t_bits;
* 1011-100 short instruction
* 1100-100 short instruction
* 1101-100 short instruction
* 1110-100 immediate characters
* 1110-100 immediate characters, various immediates and long instructions
* 1111-100 ilocs
*
* Some of the 0110100 immediates are long instructions (they dispatch
* in two steps compared to one step for a short instruction).
* The two steps are, (1) dispatch on 7 bits to the long instruction
* handler, (2) dispatch on 7 additional bits.
* Some of the 1110100 immediates are long instructions (they dispatch in
* three steps compared to one step for a short instruction). The three steps
* are, (1) dispatch on 7 bits to the long instruction handler, (2) check, if
* the immediate indicates a long instruction (rather than a character or
* other immediate) (3) dispatch on the additional bits.
*
* One way to think of it is that there are 128 short instructions,
* with the 13 immediates above being some of the most interesting.
@ -235,9 +236,7 @@ typedef unsigned long scm_t_bits;
* TYP16S functions similarly wrt to TYP16 as TYP7S to TYP7,
* but a different option bit is used (bit 2 for TYP7S,
* bit 8 for TYP16S).
* */
*/
/* {Non-immediate values.}
@ -397,7 +396,6 @@ SCM_API char *scm_isymnames[]; /* defined in print.c */
*
* These are used only in eval but their values
* have to be allocated here.
*
*/
#define SCM_IM_AND SCM_MAKSPCSYM (0)

View file

@ -1,3 +1,9 @@
2003-06-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
* tests/chars.test: Added test, attempting to apply a character.
This test will only pass if the other changes that are submitted
together with this patch are also applied.
2003-06-05 Kevin Ryde <user42@zip.com.au>
* tests/numbers.test (logcount): Add a few more tests, to exercise

View file

@ -21,6 +21,21 @@
(use-modules (test-suite lib))
(define exception:wrong-type-to-apply
(cons 'misc-error "^Wrong type to apply:"))
(with-test-prefix "basic char handling"
(with-test-prefix "evaluator"
;; Guile prior to 2003-06-05 segfaulted on the following test, because
;; within the evaluator there was no distinction between the
;; evaluator-internal instruction codes and characters.
(pass-if-exception "evaluating chars"
exception:wrong-type-to-apply
(eval '(#\0) (interaction-environment)))))
(pass-if "char-is-both? works"
(and
(not (char-is-both? #\?))