From 77d3caafb8ed8eb1de4624644475ff28998e8d3b Mon Sep 17 00:00:00 2001 From: hunt Date: Mon, 22 Jan 2007 16:56:42 +0000 Subject: [PATCH] 2007-01-22 Martin Hunt * translate.cxx (mapvar::exists): Use new _stp_map_exists function. Testing for zero is no longer correct after changes from 2007-01-10 below. --- ChangeLog | 6 ++++++ translate.cxx | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 04eb99ada..292d416e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-01-22 Martin Hunt + + * 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 * main.cxx (version): Add (C) 2007. diff --git a/translate.cxx b/translate.cxx index c6085a57c..34591c24b 100644 --- a/translate.cxx +++ b/translate.cxx @@ -520,10 +520,9 @@ struct mapvar string exists (vector 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 -- 2.43.5