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

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> hmm, that doesn't look better:
> 
> Breakpoint 1, __GI___fortify_fail (msg=msg@entry=0x7ffff69f487d "buffer
> overflow detected")
>     at fortify_fail.c:28
> 28      fortify_fail.c: No such file or directory.
> (gdb) bt
> #0  __GI___fortify_fail (msg=msg@entry=0x7ffff69f487d "buffer overflow
> detected") at fortify_fail.c:28
> #1  0x00007ffff6980240 in __GI___chk_fail () at chk_fail.c:28
> #2  0x00000000006f7716 in build_raise_check(int, exception_info_kind) ()
> #3  0x0000000000706119 in gigi ()
> #4  0x00000000009e8c90 in back_end.call_back_end ()
> #5  0x00000000009e9af7 in gnat1drv ()
> #6  0x00000000006c89ed in gnat_parse_file() ()
> #7  0x0000000000d791cf in compile_file() ()
> #8  0x00000000006acc7f in toplev::main(int, char**) ()
> #9  0x00000000006aeff7 in main ()

A little better though, thanks.  I guess it's this declaration in namet.h:

/* The global name buffer. */
struct Bounded_String
{
  Nat Max_Length;
  Nat Length;
  char Chars[1];
  /* The 1 here is wrong, but it doesn't matter, because all the code either
     goes by Length, or NUL-terminates the string before processing it. */
};

I thought this was a well-known allocation idiom in C++ because you don't have
flexible array members, do you?  That being said, I can put the real value.

Reply via email to