Index: comment.php
===================================================================
--- comment.php	(revision 37058)
+++ comment.php	(working copy)
@@ -2151,7 +2151,20 @@
 	$new = apply_filters( 'pre_wp_update_comment_count_now', null, $old, $post_id );
 
 	if ( is_null( $new ) ) {
-		$new = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1'", $post_id ) );
+
+		$bad_parents = array();
+		$depth = $_depth = get_option('thread_comments_depth', 5);
+
+		while ($depth > 1) {
+			$clause = ($_depth == $depth) ? " AND comment_approved != '1'" : null;
+			$bad_parents += $wpdb->get_col("SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = $post_id.$clause");
+			$depth--;
+		}
+
+		$bad_parents = array_unique($bad_parents);
+		$bad_parents = implode(',', $bad_parents);
+
+		$new = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' AND comment_parent NOT IN ($bad_parents)", $post_id ) );
 	} else {
 		$new = (int) $new;
 	}
