diff options
author | hunt <hunt> | 2007-01-22 16:56:42 +0000 |
---|---|---|
committer | hunt <hunt> | 2007-01-22 16:56:42 +0000 |
commit | 77d3caafb8ed8eb1de4624644475ff28998e8d3b (patch) | |
tree | 47762a4fee33e7165a6b9999495cdb762ab160d7 | |
parent | 7005d50b4b51408cd5eb1900ab5e355095664d9f (diff) | |
download | systemtap-steved-77d3caafb8ed8eb1de4624644475ff28998e8d3b.tar.gz systemtap-steved-77d3caafb8ed8eb1de4624644475ff28998e8d3b.tar.xz systemtap-steved-77d3caafb8ed8eb1de4624644475ff28998e8d3b.zip |
2007-01-22 Martin Hunt <hunt@redhat.com>
* translate.cxx (mapvar::exists): Use new _stp_map_exists function.
Testing for zero is no longer correct after changes from 2007-01-10
below.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | translate.cxx | 7 |
2 files changed, 9 insertions, 4 deletions
@@ -1,3 +1,9 @@ +2007-01-22 Martin Hunt <hunt@redhat.com> + + * translate.cxx (mapvar::exists): Use new _stp_map_exists function. + Testing for zero is no longer correct after changes from 2007-01-10 + below. + 2007-01-18 Frank Ch. Eigler <fche@elastic.org> * main.cxx (version): Add (C) 2007. diff --git a/translate.cxx b/translate.cxx index c6085a57..34591c24 100644 --- a/translate.cxx +++ b/translate.cxx @@ -520,10 +520,9 @@ struct mapvar string exists (vector<tmpvar> const & indices) const { - if (type() == pe_string) - return ("({ char *v = " + call_prefix("get", indices) - + "); (v != NULL && *v != '\\0');})"); - else if ((type() == pe_long) || (type() == pe_stats)) + if (type() == pe_long || type() == pe_string) + return (call_prefix("exists", indices) + ")"); + else if (type() == pe_stats) return ("((uintptr_t)" + call_prefix("get", indices) + ") != (uintptr_t) 0)"); else |