Fix bug in force_definition to return error code when attempting to
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Mon, 6 Nov 1989 22:00:00 +0000 (22:00 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Mon, 6 Nov 1989 22:00:00 +0000 (22:00 +0000)
force a definition in the empty environment.

v7/src/microcode/lookup.c
v8/src/microcode/lookup.c

index cea4a90aac47f226bbc8a35bea82b67d04770768..49a51fa5f5452c3060f3e731a191b90e022f60e1 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/lookup.c,v 9.42 1989/09/20 23:10:03 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/lookup.c,v 9.43 1989/11/06 22:00:00 jinx Exp $
  *
  * This file contains symbol lookup and modification routines.  See
  * Hal Abelson for a paper describing and justifying the algorithm.
@@ -1385,6 +1385,7 @@ force_definition(env, symbol, message)
 
   if (OBJECT_TYPE (env) == GLOBAL_ENV)
   {
+    *message = ERR_BAD_FRAME;
     return ((SCHEME_OBJECT *) NULL);
   }
 
@@ -1392,14 +1393,15 @@ force_definition(env, symbol, message)
   {
     previous = env;
     env = FAST_MEMORY_REF (MEMORY_REF (env, ENVIRONMENT_FUNCTION),
-                         PROCEDURE_ENVIRONMENT);
+                          PROCEDURE_ENVIRONMENT);
   } while (OBJECT_TYPE (env) != GLOBAL_ENV);
 
-  *message = Local_Set(previous, symbol, UNASSIGNED_OBJECT);
+  *message = (Local_Set (previous, symbol, UNASSIGNED_OBJECT));
   if (*message != PRIM_DONE)
+  {
     return ((SCHEME_OBJECT *) NULL);
-  return
-    deep_lookup(previous, symbol, fake_variable_object);
+  }
+  return (deep_lookup(previous, symbol, fake_variable_object));
 }
 \f
 /* Macros to allow multiprocessor interlocking in
index c3ab70fe6290fbafec578b5306a416e4849d9d37..9ed506eea7858d7a983c314d3e4497bd0842d954 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/lookup.c,v 9.42 1989/09/20 23:10:03 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/lookup.c,v 9.43 1989/11/06 22:00:00 jinx Exp $
  *
  * This file contains symbol lookup and modification routines.  See
  * Hal Abelson for a paper describing and justifying the algorithm.
@@ -1385,6 +1385,7 @@ force_definition(env, symbol, message)
 
   if (OBJECT_TYPE (env) == GLOBAL_ENV)
   {
+    *message = ERR_BAD_FRAME;
     return ((SCHEME_OBJECT *) NULL);
   }
 
@@ -1392,14 +1393,15 @@ force_definition(env, symbol, message)
   {
     previous = env;
     env = FAST_MEMORY_REF (MEMORY_REF (env, ENVIRONMENT_FUNCTION),
-                         PROCEDURE_ENVIRONMENT);
+                          PROCEDURE_ENVIRONMENT);
   } while (OBJECT_TYPE (env) != GLOBAL_ENV);
 
-  *message = Local_Set(previous, symbol, UNASSIGNED_OBJECT);
+  *message = (Local_Set (previous, symbol, UNASSIGNED_OBJECT));
   if (*message != PRIM_DONE)
+  {
     return ((SCHEME_OBJECT *) NULL);
-  return
-    deep_lookup(previous, symbol, fake_variable_object);
+  }
+  return (deep_lookup(previous, symbol, fake_variable_object));
 }
 \f
 /* Macros to allow multiprocessor interlocking in