updated for version 7.0219
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 00dcea9..ad49d45 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -911,6 +911,28 @@
 }
 
 /*
+ * Add the "self" time from the total time and the children's time.
+ */
+    void
+profile_self(self, total, children)
+    proftime_T *self, *total, *children;
+{
+    /* Check that the result won't be negative.  Can happen with recursive
+     * calls. */
+#ifdef WIN3264
+    if (total->QuadPart <= children->QuadPart)
+	return;
+#else
+    if (total->tv_sec < children->tv_sec
+	    || (total->tv_sec == children->tv_sec
+		&& total->tv_usec <= children->tv_usec))
+	return;
+#endif
+    profile_add(self, total);
+    profile_sub(self, children);
+}
+
+/*
  * Get the current waittime.
  */
     void
@@ -3000,8 +3022,8 @@
 	    profile_end(&si->sn_pr_start);
 	    profile_sub_wait(&wait_start, &si->sn_pr_start);
 	    profile_add(&si->sn_pr_total, &si->sn_pr_start);
-	    profile_add(&si->sn_pr_self, &si->sn_pr_start);
-	    profile_sub(&si->sn_pr_self, &si->sn_pr_children);
+	    profile_self(&si->sn_pr_self, &si->sn_pr_start,
+							 &si->sn_pr_children);
 	}
     }
 #endif
@@ -3505,9 +3527,9 @@
 	    ++pp->snp_count;
 	    profile_end(&si->sn_prl_start);
 	    profile_sub_wait(&si->sn_prl_wait, &si->sn_prl_start);
-	    profile_add(&pp->sn_prl_self, &si->sn_prl_start);
 	    profile_add(&pp->sn_prl_total, &si->sn_prl_start);
-	    profile_sub(&pp->sn_prl_self, &si->sn_prl_children);
+	    profile_self(&pp->sn_prl_self, &si->sn_prl_start,
+							&si->sn_prl_children);
 	}
 	si->sn_prl_idx = -1;
     }