Don't allow linking a variable to itself.
authorChris Hanson <org/chris-hanson/cph>
Thu, 8 Sep 2005 02:02:04 +0000 (02:02 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 8 Sep 2005 02:02:04 +0000 (02:02 +0000)
v7/src/microcode/lookup.c

index fbac7f5ada3f0eeb60274b5922df04d2211e3758..88b421ecf23c9a3962c08dba7be9ff0f2862bd6a 100644 (file)
@@ -1,8 +1,9 @@
 /* -*-C-*-
 
-$Id: lookup.c,v 9.70 2003/02/14 18:28:20 cph Exp $
+$Id: lookup.c,v 9.71 2005/09/08 02:02:04 cph Exp $
 
-Copyright (c) 1988-2001 Massachusetts Institute of Technology
+Copyright 1987,1988,1989,1990,1991,1992 Massachusetts Institute of Technology
+Copyright 1993,1996,1997,2000,2001,2005 Massachusetts Institute of Technology
 
 This file is part of MIT/GNU Scheme.
 
@@ -553,7 +554,8 @@ link_variables (SCHEME_OBJECT target_environment, SCHEME_OBJECT target_symbol,
   SCHEME_OBJECT * target_cell;
   
   if (! ((ENVIRONMENT_P (target_environment))
-        && (ENVIRONMENT_P (source_environment))))
+        && (ENVIRONMENT_P (source_environment))
+        && (target_environment != source_environment)))
     return (ERR_BAD_FRAME);
 
   source_cell = (find_binding_cell (source_environment, source_symbol, 0));