Changeset 12150 for branches


Ignore:
Timestamp:
09/18/09 06:31:06 (14 years ago)
Author:
Mark Evenson
Message:

Backport [svn 12149] guard against null LispStackFrames?.

Updated CHANGES to list bugs for unreleased 0.16.1.

Location:
branches/0.16.x/abcl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/0.16.x/abcl/CHANGES

    r12126 r12150  
     1Version 0.16.1
     2svn://common-lisp.net/project/armedbear/svn/branches/0.16.x/abcl
     3(Unreleased)
     4
     5Bugs fixed:
     6
     7  * More careful checking for null args in LispStackFrame
     8  * Honor appearance of &allow-other-keys in CLOS MAKE-INSTANCE
     9
    110Version 0.16.0
    2 (unreleased)
     11(06 Sep, 2009)
    312
    413  Summary of changes:
  • branches/0.16.x/abcl/src/org/armedbear/lisp/LispObject.java

    r12111 r12150  
    633633  }
    634634
    635   public String unreadableString(String s)
     635  public String unreadableString(String s) {
     636     return unreadableString(s, true);
     637  }
     638  public String unreadableString(Symbol sym) throws ConditionThrowable {
     639     return unreadableString(sym, true);
     640  }
     641
     642  public String unreadableString(String s, boolean identity)
    636643  {
    637644    FastStringBuffer sb = new FastStringBuffer("#<");
    638645    sb.append(s);
    639     sb.append(" {");
    640     sb.append(Integer.toHexString(System.identityHashCode(this)).toUpperCase());
    641     sb.append("}>");
     646    if (identity) {
     647      sb.append(" {");
     648      sb.append(Integer.toHexString(System.identityHashCode(this)).toUpperCase());
     649      sb.append("}");
     650    }
     651    sb.append(">");
    642652    return sb.toString();
    643653  }
    644654
    645   public String unreadableString(Symbol symbol) throws ConditionThrowable
    646   {
    647     FastStringBuffer sb = new FastStringBuffer("#<");
    648     sb.append(symbol.writeToString());
    649     sb.append(" {");
    650     sb.append(Integer.toHexString(System.identityHashCode(this)).toUpperCase());
    651     sb.append("}>");
    652     return sb.toString();
     655  public String unreadableString(Symbol symbol, boolean identity)
     656    throws ConditionThrowable
     657  {
     658    return unreadableString(symbol.writeToString(), identity);
    653659  }
    654660
  • branches/0.16.x/abcl/src/org/armedbear/lisp/LispStackFrame.java

    r12106 r12150  
    4343  private final LispObject[] args;
    4444
     45  private final class UnavailableArgument extends LispObject
     46  {
     47    public UnavailableArgument () { }
     48    @Override
     49    public String writeToString() {
     50      return unreadableString("unavailable arg", false);
     51    }
     52  }
     53
     54  private final LispObject UNAVAILABLE_ARG = new UnavailableArgument();
     55
    4556  public LispStackFrame(LispObject operator)
    4657  {
     
    109120       result =  unreadableString(LISP_STACK_FRAME + " "
    110121          + toLispString().getStringValue());
    111      } catch (ConditionThrowable t) {
    112        Debug.trace("Implementation error: ");
     122     } catch (Throwable t) {
     123       Debug.trace("Serious printing error: ");
    113124       Debug.trace(t);
    114125       result = unreadableString(LISP_STACK_FRAME);
     
    145156    LispObject result = Lisp.NIL;
    146157    if (args != null) {
    147       for (int i = 0; i < args.length; i++)
    148   result = result.push(args[i]);
     158        for (int i = 0; i < args.length; i++)
     159          // `args' come here from LispThread.execute. I don't know
     160          // how it comes that some callers pass NULL ptrs around but
     161          // we better do not create conses with their CAR being NULL;
     162          // it'll horribly break printing such a cons; and probably
     163          // other bad things may happen, too. --TCR, 2009-09-17.
     164          if (args[i] == null)
     165              result = result.push(UNAVAILABLE_ARG);
     166          else
     167              result = result.push(args[i]);
    149168    } else {
    150169      do {
     
    169188    throws ConditionThrowable
    170189  {
    171     return new SimpleString(toLispList().writeToString());
     190    String result;
     191    try {
     192      result = this.toLispList().writeToString();
     193    } catch (Throwable t) {
     194      Debug.trace("Serious printing error: ");
     195      Debug.trace(t);
     196      result = unreadableString("LISP-STACK-FRAME");
     197    }
     198    return new SimpleString(result);
    172199  }
    173200
Note: See TracChangeset for help on using the changeset viewer.