From: Guillermo J. Rozas Date: Mon, 6 Nov 1989 22:00:00 +0000 (+0000) Subject: Fix bug in force_definition to return error code when attempting to X-Git-Tag: 20090517-FFI~11699 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=809a64738a435ec23100c7673282f68a863b2f2b;p=mit-scheme.git Fix bug in force_definition to return error code when attempting to force a definition in the empty environment. --- diff --git a/v7/src/microcode/lookup.c b/v7/src/microcode/lookup.c index cea4a90aa..49a51fa5f 100644 --- a/v7/src/microcode/lookup.c +++ b/v7/src/microcode/lookup.c @@ -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)); } /* Macros to allow multiprocessor interlocking in diff --git a/v8/src/microcode/lookup.c b/v8/src/microcode/lookup.c index c3ab70fe6..9ed506eea 100644 --- a/v8/src/microcode/lookup.c +++ b/v8/src/microcode/lookup.c @@ -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)); } /* Macros to allow multiprocessor interlocking in