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

* eval.c (SCM_CEVAL): Allow structs implanted in code.

Previously, structs implanted in code were interpreted as forms
the operator of which was a gloc.  We solve this by checking for
the zero in the emulated vcell in the struct vtable.  Since
implanted structs always will look like forms with a gloc
operator, execution will only be slowed down by maximally one
extra test-and-branch per application.
This commit is contained in:
Mikael Djurfeldt 1998-11-20 17:14:07 +00:00
parent dc61592f84
commit aa00bd1e54
2 changed files with 17 additions and 0 deletions

View file

@ -1995,6 +1995,9 @@ dispatch:
case scm_tcs_cons_gloc:
proc = SCM_GLOC_VAL (SCM_CAR (x));
if (proc == 0)
/* This is a struct implanted in the code, not a gloc. */
RETURN (x);
SCM_ASRTGO (SCM_NIMP (proc), badfun);
#ifndef SCM_RECKLESS
#ifdef SCM_CAUTIOUS