summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McQueen <simon.mcqueen@gmail.com>2004-08-12 17:00:42 +0000
committerSimon McQueen <simon.mcqueen@gmail.com>2004-08-12 17:00:42 +0000
commite3171a364dd491672dba94f187ca3a98c77c6bb3 (patch)
tree3cb89cf701117dad5e0ed9a9c5889247d75ed11a
parent0a06166ce38a21d6aff99c881bb64a8062949204 (diff)
downloadATCD-e3171a364dd491672dba94f187ca3a98c77c6bb3.tar.gz
ChangeLogTag: Thu Aug 12 17:51:52 2004 Simon McQueen <sm@prismtechnologies.com>
-rw-r--r--TAO/ChangeLog14
-rw-r--r--TAO/TAO_IDL/fe/fe_lookup.cpp9
-rw-r--r--TAO/tests/Bug_1904_Regression/test.cpp12
-rw-r--r--TAO/tests/Bug_1904_Regression/test.idl5
-rw-r--r--TAO/tests/Bug_1904_Regression/test.mpc7
5 files changed, 44 insertions, 3 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 77048fd3a2c..a2d3c32ebc8 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,17 @@
+Thu Aug 12 17:51:52 2004 Simon McQueen <sm@prismtechnologies.com>
+
+ * TAO_IDL/fe/fe_lookup.cpp (lookup):
+ Added test for matching string lengths to prevent incorrect
+ identification of non-keyword strings as c++ keywords.
+
+ This fixes bugzilla #1904.
+
+ * tests/Bug_1904_Regression/test.cpp:
+ * tests/Bug_1904_Regression/test.idl:
+ * tests/Bug_1904_Regression/test.mpc:
+
+ Regression test for the above.
+
Thu Aug 12 11:56:12 UTC 2004 Johnny Willemsen <jwillemsen@remedy.nl>
* tao/IIOP_Transport.cpp:
diff --git a/TAO/TAO_IDL/fe/fe_lookup.cpp b/TAO/TAO_IDL/fe/fe_lookup.cpp
index e155f034043..5a424f5eb55 100644
--- a/TAO/TAO_IDL/fe/fe_lookup.cpp
+++ b/TAO/TAO_IDL/fe/fe_lookup.cpp
@@ -181,10 +181,13 @@ TAO_IDL_CPP_Keyword_Table::lookup (const char *str, unsigned int len)
if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
{
- const char *s = wordlist[key].keyword_;
+ if (len == static_cast<int> (ACE_OS::strlen (wordlist[key].keyword_)))
+ {
+ const char *s = wordlist[key].keyword_;
- if (*str == *s && !ACE_OS::strncmp (str + 1, s + 1, len - 1))
- return &wordlist[key];
+ if (*str == *s && !ACE_OS::strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[key];
+ }
}
}
return 0;
diff --git a/TAO/tests/Bug_1904_Regression/test.cpp b/TAO/tests/Bug_1904_Regression/test.cpp
new file mode 100644
index 00000000000..14a9a528d65
--- /dev/null
+++ b/TAO/tests/Bug_1904_Regression/test.cpp
@@ -0,0 +1,12 @@
+// $Id$
+#include "testS.h"
+
+class con_i : public virtual POA_con
+{
+};
+
+int
+main (int argc , char *argv[])
+{
+ return 0;
+}
diff --git a/TAO/tests/Bug_1904_Regression/test.idl b/TAO/tests/Bug_1904_Regression/test.idl
new file mode 100644
index 00000000000..766591f6d84
--- /dev/null
+++ b/TAO/tests/Bug_1904_Regression/test.idl
@@ -0,0 +1,5 @@
+// $Id$
+interface con
+{
+};
+
diff --git a/TAO/tests/Bug_1904_Regression/test.mpc b/TAO/tests/Bug_1904_Regression/test.mpc
new file mode 100644
index 00000000000..b0f27fee2a6
--- /dev/null
+++ b/TAO/tests/Bug_1904_Regression/test.mpc
@@ -0,0 +1,7 @@
+project : taoserver {
+ exename = test
+ Source_Files {
+ test.cpp
+ }
+}
+