diff options
author | dsmith <dsmith> | 2006-05-05 16:21:56 +0000 |
---|---|---|
committer | dsmith <dsmith> | 2006-05-05 16:21:56 +0000 |
commit | 4c82f679ba1653c28c22081117a5c4b6cb9e8984 (patch) | |
tree | a6fc750a34a533e0424a67b1459dd6a37c1671ba | |
parent | fd64709f63938fcc8e82c0c7663cad2289f09211 (diff) | |
download | systemtap-steved-4c82f679ba1653c28c22081117a5c4b6cb9e8984.tar.gz systemtap-steved-4c82f679ba1653c28c22081117a5c4b6cb9e8984.tar.xz systemtap-steved-4c82f679ba1653c28c22081117a5c4b6cb9e8984.zip |
2006-05-05 David Smith <dsmith@redhat.com>
* translate.cxx (mapvar::exists): Added code for string array
handling. Otherwise, string array elements always exist.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | translate.cxx | 9 |
2 files changed, 13 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2006-05-05 David Smith <dsmith@redhat.com> + + * translate.cxx (mapvar::exists): Added code for string array + handling. Otherwise, string array elements always exist. + 2006-05-03 Josh Stone <joshua.i.stone@intel.com> PR 2506 diff --git a/translate.cxx b/translate.cxx index ddbeea0d..30601cf2 100644 --- a/translate.cxx +++ b/translate.cxx @@ -550,7 +550,14 @@ struct mapvar string exists (vector<tmpvar> const & indices) const { - return "((uintptr_t)" + call_prefix("get", indices) + ") != (uintptr_t) 0)"; + if (type() == pe_string) + return ("({ char *v = " + call_prefix("get", indices) + + "); (v != NULL && *v != '\\0');})"); + else if ((type() == pe_long) || (type() == pe_stats)) + return ("((uintptr_t)" + call_prefix("get", indices) + + ") != (uintptr_t) 0)"); + else + throw semantic_error("checking existence of an unsupported map type"); } string get (vector<tmpvar> const & indices, bool pre_agg=false) const |