Message ID | 20100924004002.GA1079@bromo.med.uc.edu |
---|---|
State | New |
Headers | show |
On Fri, Sep 24, 2010 at 2:40 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote: > The commit of r164532 broke the bootstrap on darwin in stage1 > due to the incorrect passing to sizeof of a pointer to a struct > rather than the struct itself. The attached patch corrects this > error and restores the bootstrap on darwin. Bootstrap and > regression tested on x86_64-apple-darwin10. Okay for gcc trunk? > Jack Looks obvious. Thanks, Richard. > 2010-09-23 Dominique Dhumieres <dominiq@lps.ens.fr> > Jack Howarth <howarth@bromo.med.uc.edu> > > PR 45751/target > > * gcc/config/darwin-driver.c: Pass struct to sizeof. > > > Index: gcc/config/darwin-driver.c > =================================================================== > --- gcc/config/darwin-driver.c (revision 164573) > +++ gcc/config/darwin-driver.c (working copy) > @@ -76,7 +76,7 @@ > generate_option (OPT_mmacosx_version_min_, macosx_deployment_target, > 1, CL_DRIVER, &(*decoded_options)[1]); > memcpy (*decoded_options + 2, argv + 1, > - (argc - 1) * sizeof (struct cl_decoded_option *)); > + (argc - 1) * sizeof (struct cl_decoded_option)); > return; > } > } > @@ -128,7 +128,7 @@ > generate_option (OPT_mmacosx_version_min_, new_flag, > 1, CL_DRIVER, &(*decoded_options)[1]); > memcpy (*decoded_options + 2, argv + 1, > - (argc - 1) * sizeof (struct cl_decoded_option *)); > + (argc - 1) * sizeof (struct cl_decoded_option)); > return; > > parse_failed: >
Index: gcc/config/darwin-driver.c =================================================================== --- gcc/config/darwin-driver.c (revision 164573) +++ gcc/config/darwin-driver.c (working copy) @@ -76,7 +76,7 @@ generate_option (OPT_mmacosx_version_min_, macosx_deployment_target, 1, CL_DRIVER, &(*decoded_options)[1]); memcpy (*decoded_options + 2, argv + 1, - (argc - 1) * sizeof (struct cl_decoded_option *)); + (argc - 1) * sizeof (struct cl_decoded_option)); return; } } @@ -128,7 +128,7 @@ generate_option (OPT_mmacosx_version_min_, new_flag, 1, CL_DRIVER, &(*decoded_options)[1]); memcpy (*decoded_options + 2, argv + 1, - (argc - 1) * sizeof (struct cl_decoded_option *)); + (argc - 1) * sizeof (struct cl_decoded_option)); return; parse_failed: