public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/98608] New: missing sanitizer detection for arrays with invalid length defind using typeof
@ 2021-01-08 21:39 muecker at gwdg dot de
  2021-01-11  8:14 ` [Bug sanitizer/98608] " marxin at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: muecker at gwdg dot de @ 2021-01-08 21:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98608
           Summary: missing sanitizer detection for arrays with invalid
                    length defind using typeof
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: muecker at gwdg dot de
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---

The following invalid code is not detected with -fsanitize=undefined

void f(int n, double (*x)[n])
{
        typeof(*x) y;
//      double y[n];
}

int main()
{
        f(-1, 0);
}

Using the definition without typedef yields:

src/test.c:5:9: runtime error: variable length array bound evaluates to
non-positive value -1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-01 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08 21:39 [Bug sanitizer/98608] New: missing sanitizer detection for arrays with invalid length defind using typeof muecker at gwdg dot de
2021-01-11  8:14 ` [Bug sanitizer/98608] " marxin at gcc dot gnu.org
2023-07-30 10:09 ` muecker at gwdg dot de
2023-11-01 12:35 ` muecker at gwdg dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).