From e3171a364dd491672dba94f187ca3a98c77c6bb3 Mon Sep 17 00:00:00 2001 From: Simon McQueen Date: Thu, 12 Aug 2004 17:00:42 +0000 Subject: ChangeLogTag: Thu Aug 12 17:51:52 2004 Simon McQueen --- TAO/ChangeLog | 14 ++++++++++++++ TAO/TAO_IDL/fe/fe_lookup.cpp | 9 ++++++--- TAO/tests/Bug_1904_Regression/test.cpp | 12 ++++++++++++ TAO/tests/Bug_1904_Regression/test.idl | 5 +++++ TAO/tests/Bug_1904_Regression/test.mpc | 7 +++++++ 5 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 TAO/tests/Bug_1904_Regression/test.cpp create mode 100644 TAO/tests/Bug_1904_Regression/test.idl create mode 100644 TAO/tests/Bug_1904_Regression/test.mpc 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 + + * 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 * 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 (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 + } +} + -- cgit v1.2.1