Changeset 5645 in webkit for trunk/JavaScriptCore/kjs/object.cpp


Ignore:
Timestamp:
Dec 2, 2003, 2:11:47 AM (21 years ago)
Author:
mjs
Message:

Merged patches from Harri Porten and David Faure to fix:

<rdar://problem/3497643>: reproducible crash printing self-referential array

  • kjs/array_object.cpp: (ArrayProtoFuncImp::call): Break out of the loop if an exception was thrown.
  • kjs/nodes.cpp: (FunctionCallNode::evaluate): Move function call depth check from here...
  • kjs/object.cpp: (KJS::Object::call): ...to here.
  • kjs/object.h: Un-inline Object::call now that it does more.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/object.cpp

    r5581 r5645  
    5252}
    5353
     54
     55Value Object::call(ExecState *exec, Object &thisObj, const List &args)
     56{
     57#if KJS_MAX_STACK > 0
     58  static int depth = 0; // sum of all concurrent interpreters
     59  if (++depth > KJS_MAX_STACK) {
     60    --depth;
     61    Object err = Error::create(exec, RangeError,
     62                               "Maximum call stack size exceeded.");
     63    exec->setException(err);
     64    return err;
     65  }
     66#endif
     67
     68  Value ret = imp()->call(exec,thisObj,args);
     69
     70#if KJS_MAX_STACK > 0
     71  --depth;
     72#endif
     73
     74  return ret;
     75}
     76
    5477// ------------------------------ ObjectImp ------------------------------------
    5578
Note: See TracChangeset for help on using the changeset viewer.