[omniORB] omniidl assert error about comments after upgrade from 2.8 to 3

Duncan Grisby dgrisby@uk.research.att.com
Thu, 16 Mar 2000 17:37:14 +0000


On Thursday 16 March, Richard Gruet wrote:
>     >omniidl -N -CmyOutDir -bpython
> d:\Divan2\main\src\INA\idl\DataModel_.idl
>     Assertion failed: mostRecent_, file idlast.cc, line 128

Oops. Silly mistake. I've added support for passing comments on to the
back-end, and broke it for the case that keeping comments was turned
off, but comments appeared in omniidl's input.

Here's a patch which fixes it. It's also in CVS.

Cheers,

Duncan.

diff -u -r1.14.2.2 idlast.cc
--- src/tool/omniidl/cxx/idlast.cc	2000/03/07 10:31:26	1.14.2.2
+++ src/tool/omniidl/cxx/idlast.cc	2000/03/16 17:27:07
@@ -125,13 +125,15 @@
 Comment::
 append(const char* commentText)
 {
-  assert(mostRecent_);
-  char* newText = new char[(strlen(mostRecent_->commentText_) +
-			    strlen(commentText) + 1)];
-  strcpy(newText, mostRecent_->commentText_);
-  strcat(newText, commentText);
-  delete [] mostRecent_->commentText_;
-  mostRecent_->commentText_ = newText;
+  if (Config::keepComments) {
+    assert(mostRecent_);
+    char* newText = new char[(strlen(mostRecent_->commentText_) +
+			      strlen(commentText) + 1)];
+    strcpy(newText, mostRecent_->commentText_);
+    strcat(newText, commentText);
+    delete [] mostRecent_->commentText_;
+    mostRecent_->commentText_ = newText;
+  }
 }


-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --