~ubuntu-branches/ubuntu/trusty/mit-scheme/trusty

« back to all changes in this revision

Viewing changes to src/microcode/lookup.c

  • Committer: Bazaar Package Importer
  • Author(s): Chris Hanson
  • Date: 2010-03-10 02:00:45 UTC
  • mfrom: (1.1.7 upstream) (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100310020045-4np1y3ro6sk2oz92
Tags: 9.0.1-1
* New upstream.
* debian/watch: Fix, previous version was broken.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*-C-*-
2
2
 
3
 
$Id: lookup.c,v 9.78 2008/02/02 17:57:36 cph Exp $
4
 
 
5
3
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
6
4
    1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
7
 
    2006, 2007, 2008 Massachusetts Institute of Technology
 
5
    2006, 2007, 2008, 2009, 2010 Massachusetts Institute of Technology
8
6
 
9
7
This file is part of MIT/GNU Scheme.
10
8
 
444
442
    SCHEME_OBJECT * cell = (scan_frame (environment, symbol, 1));
445
443
    SCHEME_OBJECT old_value;
446
444
    if (cell != 0)
447
 
      return (assign_variable_end (cell, value, (&old_value), 1));
 
445
      {
 
446
        if (GLOBAL_FRAME_P (environment))
 
447
          strengthen_symbol (symbol);
 
448
        return (assign_variable_end (cell, value, (&old_value), 1));
 
449
      }
448
450
  }
449
451
 
450
452
  /* At this point, we know that environment can't be the global
565
567
  if (target_cell == source_cell)
566
568
    return (PRIM_DONE);
567
569
 
 
570
  if ((target_cell != 0) && (GLOBAL_FRAME_P (target_environment)))
 
571
    strengthen_symbol (target_symbol);
 
572
 
568
573
  if ((target_cell != 0)
569
574
      && ((get_trap_kind (*target_cell)) == TRAP_COMPILER_CACHED))
570
575
    {
635
640
{
636
641
  SCHEME_OBJECT frame;
637
642
  SCHEME_OBJECT * cell = (find_binding_cell (environment, symbol, (&frame)));
 
643
  if (GLOBAL_FRAME_P (frame))
 
644
    weaken_symbol (symbol);
638
645
  switch ((cell == 0) ? TRAP_UNBOUND : (get_trap_kind (*cell)))
639
646
    {
640
647
    case TRAP_UNBOUND:
887
894
                     SCHEME_OBJECT block, unsigned long offset,
888
895
                     unsigned int reference_kind)
889
896
{
890
 
  SCHEME_OBJECT * cell = (find_binding_cell (environment, symbol, 0));
 
897
  SCHEME_OBJECT frame = 0;
 
898
  SCHEME_OBJECT * cell = (find_binding_cell (environment, symbol, (&frame)));
891
899
  SCHEME_OBJECT dummy_cell = UNBOUND_OBJECT;
892
900
  if (cell == 0)
893
901
    /* There's no binding for the variable, and we don't have access
895
903
       we'll install one, but it won't be attached to any environment
896
904
       structure.  */
897
905
    cell = (&dummy_cell);
 
906
  else if (GLOBAL_FRAME_P (frame))
 
907
    strengthen_symbol (symbol);
898
908
  /* This procedure must complete to keep the data structures
899
909
     consistent, so we do a GC check in advance to guarantee that all
900
910
     of the allocations will finish.  */