From: Iain Sandoe Date: Wed, 19 Jun 2019 16:07:58 +0000 (+0000) Subject: [Darwin] Fix two off-by-one errors in the driver. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=33f0ad50f48cefeec7f3136e30229c9f85bbd372;p=gcc.git [Darwin] Fix two off-by-one errors in the driver. 2019-06-19 Iain Sandoe * config/darwin-driver.c (darwin_driver_init): Fix off-by-one errors in computing the number of options to be moved. From-SVN: r272479 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e5c455f3b8d..919ceafd3a3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-06-19 Iain Sandoe + + * config/darwin-driver.c (darwin_driver_init): Fix off-by-one errors + in computing the number of options to be moved. + 2019-06-19 Maya Rashish * config/arm/netbsd-elf.h (SYSARCH_ARM_SYNC_ICACHE): New definition. diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c index 01238e2634d..3d85f29cb3d 100644 --- a/gcc/config/darwin-driver.c +++ b/gcc/config/darwin-driver.c @@ -261,7 +261,7 @@ darwin_driver_init (unsigned int *decoded_options_count, if (*decoded_options_count > i) { memmove (*decoded_options + i, *decoded_options + i + 1, - ((*decoded_options_count - i) + ((*decoded_options_count - i - 1) * sizeof (struct cl_decoded_option))); } --i; @@ -307,7 +307,7 @@ darwin_driver_init (unsigned int *decoded_options_count, if (*decoded_options_count > i) { memmove (*decoded_options + i, *decoded_options + i + 1, - ((*decoded_options_count - i) + ((*decoded_options_count - i - 1) * sizeof (struct cl_decoded_option))); } --i;