This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] symtab.c -- fix off by one bugs


The following patch has been applied to symtab.c:

Fri Aug 25 12:11:21 2000  David Taylor  <taylor@texas.cygnus.com>

	* symtab.c (search_symbols): Fix off by one error in index for
 	initializing variables ourtype, ourtype2, ourtype3, and ourtype4.
	(symtab_symbol_info): fix similar off by one error.
	
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -c -r1.12 -r1.13
*** symtab.c	2000/08/11 01:02:35	1.12
--- symtab.c	2000/08/25 20:51:19	1.13
***************
*** 3573,3582 ****
    if (kind < LABEL_NAMESPACE)
      error ("must search on specific namespace");
  
!   ourtype = types[(int) (kind - LABEL_NAMESPACE)];
!   ourtype2 = types2[(int) (kind - LABEL_NAMESPACE)];
!   ourtype3 = types3[(int) (kind - LABEL_NAMESPACE)];
!   ourtype4 = types4[(int) (kind - LABEL_NAMESPACE)];
  
    sr = *matches = NULL;
    tail = NULL;
--- 3573,3582 ----
    if (kind < LABEL_NAMESPACE)
      error ("must search on specific namespace");
  
!   ourtype = types[(int) (kind - VARIABLES_NAMESPACE)];
!   ourtype2 = types2[(int) (kind - VARIABLES_NAMESPACE)];
!   ourtype3 = types3[(int) (kind - VARIABLES_NAMESPACE)];
!   ourtype4 = types4[(int) (kind - VARIABLES_NAMESPACE)];
  
    sr = *matches = NULL;
    tail = NULL;
***************
*** 3903,3909 ****
    printf_filtered (regexp
  		   ? "All %ss matching regular expression \"%s\":\n"
  		   : "All defined %ss:\n",
! 		   classnames[(int) (kind - LABEL_NAMESPACE - 1)], regexp);
  
    for (p = symbols; p != NULL; p = p->next)
      {
--- 3903,3909 ----
    printf_filtered (regexp
  		   ? "All %ss matching regular expression \"%s\":\n"
  		   : "All defined %ss:\n",
! 		   classnames[(int) (kind - VARIABLES_NAMESPACE)], regexp);
  
    for (p = symbols; p != NULL; p = p->next)
      {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]