Commit 33f0ad50 by Iain Sandoe Committed by Iain Sandoe

[Darwin] Fix two off-by-one errors in the driver.

2019-06-19  Iain Sandoe  <iain@sandoe.co.uk>

        * config/darwin-driver.c (darwin_driver_init): Fix off-by-one errors
        in computing the number of options to be moved.

From-SVN: r272479
parent 742f80b1
2019-06-19 Iain Sandoe <iain@sandoe.co.uk>
* 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 <coypu@sdf.org>
* config/arm/netbsd-elf.h (SYSARCH_ARM_SYNC_ICACHE): New definition.
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment