🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #818

g++ Version 2.2.2 core dump in cc1plus

#818
From: Jody Winston
Date: Tue, 18 Aug 1992 20:30
62 lines
2268 bytes
In g++ 2.2.2 and the current snapshot 920814, the following two code
fragement show two possible locations for NULL derferences in cc1plus.
The diff is from the snapshot and it doesn't attempt to solve the
problem NULL pointer problem, but instead it tries to avoid a core
dump.  I'll try to get a small C++ example that causes the above
failures.


*** 1.9	1992/08/11 16:18:26
--- cp-class.c	1992/08/18 20:12:18
***************
*** 928,936 ****
  	  tree context_binfo = binfo_value (base_context, base, 0);
  	  prepare_fresh_vtable (vbases, context_binfo, t);
  	}
!       modify_vtable_entry (get_vtable_entry (BINFO_VIRTUALS (vbases), base_fndecl),
! 			   build_vtable_entry (this_offset, pfn),
! 			   fndecl, base_context);
      skip: {}
      }
  }
--- 928,942 ----
  	  tree context_binfo = binfo_value (base_context, base, 0);
  	  prepare_fresh_vtable (vbases, context_binfo, t);
  	}
!       if (! BINFO_VIRTUALS (vbases))
!       {
! 	 modify_vtable_entry (get_vtable_entry (BINFO_VIRTUALS (vbases), base_fndecl),
! 			      build_vtable_entry (this_offset, pfn),
! 			      fndecl, base_context);
!       }
!       else
! 	 fprintf(stderr, "Warning BINFO_VIRTUALS (vbases) == NULL\n");
! 
      skip: {}
      }
  }
*** 1.8	1992/08/11 16:18:26
--- cp-typeck.c	1992/08/18 20:11:56
***************
*** 1575,1580 ****
--- 1575,1587 ----
      }
  
    itype = TREE_TYPE (index);
+ 
+   if (!itype)
+   {
+      error("itype is equal to NULL");
+      return error_mark_node;
+   }
+   
    if (TREE_CODE (itype) == REFERENCE_TYPE)
      {
        index = convert_from_reference (index);


Jody Winston		jody@shell.com
..!{sun,psuvax1,bcm,rice,decwrl,cs.utexas.edu}!shell!jody
Consultant to:
Shell Development Company, Bellaire Research Center
P.O. Box 481, Room 4205, Houston, TX 77001	(Voice: 713 245-7574)
Technical Details
Message-ID: <9208182030.AA16519@patriot.brc.shell.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!shell.COM!jody

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!shell.COM!jody
From: jody@shell.COM (Jody Winston)
Subject: g++ Version 2.2.2 core dump in cc1plus
Message-ID: <9208182030.AA16519@patriot.brc.shell.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 18 Aug 1992 20:30:39 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 64