From: Chris Hanson Date: Thu, 8 Sep 2005 02:31:19 +0000 (+0000) Subject: Ignore attempt to link variable to itself. X-Git-Tag: 20090517-FFI~1223 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=4b78858315bbe10b89064c6a21a43b96980acb50;p=mit-scheme.git Ignore attempt to link variable to itself. --- diff --git a/v7/src/microcode/lookup.c b/v7/src/microcode/lookup.c index 88b421ecf..43482252f 100644 --- a/v7/src/microcode/lookup.c +++ b/v7/src/microcode/lookup.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: lookup.c,v 9.71 2005/09/08 02:02:04 cph Exp $ +$Id: lookup.c,v 9.72 2005/09/08 02:31:19 cph Exp $ Copyright 1987,1988,1989,1990,1991,1992 Massachusetts Institute of Technology Copyright 1993,1996,1997,2000,2001,2005 Massachusetts Institute of Technology @@ -554,8 +554,7 @@ link_variables (SCHEME_OBJECT target_environment, SCHEME_OBJECT target_symbol, SCHEME_OBJECT * target_cell; if (! ((ENVIRONMENT_P (target_environment)) - && (ENVIRONMENT_P (source_environment)) - && (target_environment != source_environment))) + && (ENVIRONMENT_P (source_environment)))) return (ERR_BAD_FRAME); source_cell = (find_binding_cell (source_environment, source_symbol, 0)); @@ -567,6 +566,9 @@ link_variables (SCHEME_OBJECT target_environment, SCHEME_OBJECT target_symbol, return (ERR_UNBOUND_VARIABLE); target_cell = (scan_frame (target_environment, target_symbol, 1)); + if (target_cell == source_cell) + return (PRIM_DONE); + if ((target_cell != 0) && ((get_trap_kind (*target_cell)) == TRAP_COMPILER_CACHED)) {