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


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


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