Changeset 5116


Ignore:
Timestamp:
12/13/03 15:21:10 (18 years ago)
Author:
piso
Message:

THROW: check for valid catch tag and signal control error if not.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/Primitives.java

    r5110 r5116  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Primitives.java,v 1.527 2003-12-12 19:13:35 piso Exp $
     5 * $Id: Primitives.java,v 1.528 2003-12-13 15:21:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    16861686                        LispObject[] handlerArgs = new LispObject[1];
    16871687                        handlerArgs[0] = condition;
    1688                          // Might not return.
     1688                        // Might not return.
    16891689                        funcall(handler, handlerArgs, thread);
    16901690                    }
     
    30643064
    30653065    // ### go
    3066     private static final SpecialOperator GO = new SpecialOperator("go") {
     3066    private static final SpecialOperator GO = new SpecialOperator("go")
     3067    {
    30673068        public LispObject execute(LispObject args, Environment env)
    30683069            throws ConditionThrowable
     
    32133214            LispObject tag = eval(args.car(), env, thread);
    32143215            LispObject result = eval(args.cadr(), env, thread);
    3215             throw new Throw(tag, result);
     3216            if (thread.isValidCatchTag(tag))
     3217                throw new Throw(tag, result);
     3218            else
     3219                return signal(new ControlError("attempt to throw to the non-existent tag " + tag));
    32163220        }
    32173221    };
Note: See TracChangeset for help on using the changeset viewer.