Index: devel.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/devel/devel.module,v
retrieving revision 1.258.2.1
diff -u -p -r1.258.2.1 devel.module
@@ -1228,8 +1228,14 @@ function devel_print_object($object, $pr
  * @todo
  *   currently there are problems sending an array with a varname
  */
-function _devel_print_object($obj, $prefix = NULL, $parents = NULL, $object = FALSE) {
+function _devel_print_object($obj, $prefix = NULL, $parents = NULL, $object = FALSE, $depth = 0) {
   static $root_type, $out_format;
+  if ($depth > variable_get('devel_recursion_depth', 9)) {
+    $output = '<dl><span class="devel-attr"><dt><span class="field error">';
+    $output .= t('ERROR: recursion depth maximum exceeded.');
+    $output .= '</span></dt></span></dl>';
+    return $output;
+  }
   if (!isset($root_type)) {
     $root_type = gettype($obj);
     if ($root_type == 'object') {
@@ -1296,10 +1302,10 @@ function _devel_print_object($obj, $pref
       $output .= "<dt><span class=\"field\">{$prefix}{$field}</span> $typesum</dt>\n";
       $output .= "<dd>\n";
       if (is_array($value)) {
-        $output .= _devel_print_object($value, $prefix, $field);
+        $output .= _devel_print_object($value, $prefix, $field, FALSE, $depth++);
       }
       elseif (is_object($value)) {
-        $output .= _devel_print_object((array)$value, $prefix, $field, TRUE);
+        $output .= _devel_print_object((array)$value, $prefix, $field, TRUE, $depth++);
       }
       else {
         $value = is_bool($value) ? ($value ? 'TRUE' : 'FALSE') : $value;

