]> sourceware.org Git - systemtap.git/commitdiff
2006-01-17 Josh Stone <joshua.i.stone@intel.com>
authorjistone <jistone>
Wed, 18 Jan 2006 02:06:19 +0000 (02:06 +0000)
committerjistone <jistone>
Wed, 18 Jan 2006 02:06:19 +0000 (02:06 +0000)
PR 2156
* translate.cxx (c_unparser::visit_foreach_loop): Check the return
value of _stp_pmap_agg() for NULL.

ChangeLog
translate.cxx

index 5d7ecaf8f393cf40f1b7ce9ce8fe218af06a3771..a18316669dc015c06751edaae7d14ba1aabc927f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-01-17  Josh Stone  <joshua.i.stone@intel.com>
+
+       PR 2156
+       * translate.cxx (c_unparser::visit_foreach_loop): Check the return
+       value of _stp_pmap_agg() for NULL.
+
 2006-01-17  Frank Ch. Eigler  <fche@elastic.org>
 
        * systemtap.spec.in: Remove explicit kernel-devel dependency,
index 01179e2ff8482b2712445b8d560a30bb3db2bdc9..ba3836821727c4d1d484077e4ff4ee998aaa033a 100644 (file)
@@ -2021,11 +2021,17 @@ c_unparser::visit_foreach_loop (foreach_loop *s)
       if (mv.is_parallel())
        {
          varlock_w agg_and_maybe_sort_guard(*this, mv);
-         o->newline() << mv.calculate_aggregate() << ";";
+         o->newline() << "if (unlikely(NULL == " << mv.calculate_aggregate() << "))";
+         o->newline(1) << "c->last_error = \"unknown error while aggregating " << mv << "\";";
+         o->indent(-1);
+
          // sort array if desired
-         if (s->sort_direction)
-           o->newline() << "_stp_map_sort (" << mv.fetch_existing_aggregate() << ", "
-                        << s->sort_column << ", " << - s->sort_direction << ");";
+         if (s->sort_direction) {
+           o->newline() << "else"; // only sort if aggregation was ok
+           o->newline(1) << "_stp_map_sort (" << mv.fetch_existing_aggregate() << ", "
+                         << s->sort_column << ", " << - s->sort_direction << ");";
+           o->indent(-1);
+         }
        }
       else
        {      
This page took 0.045782 seconds and 5 git commands to generate.