This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/61831] [4.9/ 5 Regression] runtime error: pointer being freed was not allocated


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61831

--- Comment #36 from Mikael Morin <mikael at gcc dot gnu.org> ---
>    [...]
>     (*(struct string_t[1] * restrict) atmp.7.data)[0] = prt_in;

prt_in.chars.data is copied to atmp.7.data[0].

>    [...]
>    while (1)
>      {
>        [...]
>        D.3430 = (*(struct string_t[1] * restrict) atmp.7.data)[S.10];

atmp.7.data[0].chars.data is copied to D.3430

>        [...]
>        if (D.3430.chars.data != 0B)
>          {
>            __builtin_free ((void *) D.3430.chars.data);
>          }
>        D.3430.chars.data = 0B;

D.3430.chars.data is freed.


So every iteration of the do loop has the side-effect of freeing
prt_in.chars.data.


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