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]
Other format: [Raw text]

Re: Minor off-by-one error in command_line_handler


Does
/* We're careful not to read beyond the last BLOCK_SYM.  */
look about right to you?

On Fri, Mar 29, 2002 at 12:35:33PM -0500, Andrew Cagney wrote:
> It at least deserves a comment :-)
> 
> > #define ALL_BLOCK_SYMBOLS(bl, i, sym)			\
> > 	for ((i) = 0, (sym) = BLOCK_SYM ((bl), (i));	\
> > 	     (i) < BLOCK_NSYMS ((bl));			\
> >-	     ++(i), (sym) = BLOCK_SYM ((bl), (i)))
> >+	     ++(i), (sym) = ((i) < BLOCK_NSYMS ((bl)))	\
> >+			    ? BLOCK_SYM ((bl), (i))	\
> >+			    : NULL)
> > 
> 
> Andrew
> 
> 

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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