Software: Apache. PHP/5.4.45 

uname -a: Linux webm056.cluster010.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue
Sep 17 08:14:20 UTC 2024 x86_64
 

uid=243112(mycochar) gid=100(users) groups=100(users)  

Safe-mode: OFF (not secure)

/home/mycochar/www/image/photo/gcc-12.3.0/gcc/testsuite/g++.dg/warn/   drwxr-xr-x
Free 0 B of 0 B (0%)
Your ip: 216.73.216.77 - Server ip: 213.186.33.19
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    

[Enumerate]    [Encoder]    [Tools]    [Proc.]    [FTP Brute]    [Sec.]    [SQL]    [PHP-Code]    [Backdoor Host]    [Back-Connection]    [milw0rm it!]    [PHP-Proxy]    [Self remove]
    


Viewing file:     Warray-bounds-23.C (6.29 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* PR middle-end/99502 - missing -Warray-bounds on partial out of bounds
   access in C++
   { dg-do compile }
   { dg-options "-O2 -Wall" } */

inline void* operator new (__SIZE_TYPE__, void *p) { return p; }

struct B0 { int b0i; };
struct B1: virtual B0 { int b1i; };
struct B2: virtual B0 { int b2i; };
struct D1: B1, B2 { int d1i; };
struct D2: D1 { int d2i; };
struct D3: D2 { long d3i, d3ax[]; };

void sink (void*);


void test_D1 ()
{
  {
    char *p = new char[sizeof (D1)];
    new (p) D1 ();
    sink (p);
  }

  {
    char *p = new char[sizeof (D1) - 1];
    new (p) D1 ();                      // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D1_b0i ()
{
  {
    D1 *p = (D1*)new char[sizeof (D1)];
    p->b0i = __LINE__;
    sink (p);
  }

  {
    D1 *p = (D1*)new char[3];
    p->b0i = __LINE__;                   // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D1_b1i ()
{
  {
    D1 *p = (D1*)new char[sizeof (D1)];
    p->b1i = __LINE__;
    sink (p);
  }

  {
    D1 *p = (D1*)new char[3];
    p->b1i = __LINE__;                   // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D1_b2i ()
{
  {
    D1 *p = (D1*)new char[sizeof (D1)];
    p->b2i = __LINE__;
    sink (p);
  }

  {
    D1 *p = (D1*)new char[3];
    p->b2i = __LINE__;                   // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D1_d1i ()
{
  {
    D1 *p = (D1*)new char[sizeof (D1)];
    p->d1i = __LINE__;
    sink (p);
  }

  {
    D1 *p = (D1*)new char[3];
    p->d1i = __LINE__;                   // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}


void test_D2 ()
{
  {
    char *p = new char[sizeof (D2)];
    new (p) D2 ();
    sink (p);
  }

  {
    char *p = new char[sizeof (D2) - 1];
    new (p) D2 ();                      // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D2_b0i ()
{
  {
    D2 *p = (D2*)new char[sizeof (D2)];
    p->b0i = __LINE__;
    sink (p);
  }

  {
    D2 *p = (D2*)new char[3];
    p->b0i = __LINE__;                   // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D2_b1i ()
{
  {
    D2 *p = (D2*)new char[sizeof (D2)];
    p->b1i = __LINE__;
    sink (p);
  }

  {
    D2 *p = (D2*)new char[3];
    p->b1i = __LINE__;                   // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D2_b2i ()
{
  {
    D2 *p = (D2*)new char[sizeof (D2)];
    p->b2i = __LINE__;
    sink (p);
  }

  {
    D2 *p = (D2*)new char[3];
    p->b2i = __LINE__;                   // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D2_d1i ()
{
  {
    D2 *p = (D2*)new char[sizeof (D2)];
    p->d1i = __LINE__;
    sink (p);
  }

  {
    D2 *p = (D2*)new char[3];
    p->d1i = __LINE__;                   // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D2_d2i ()
{
  {
    D2 *p = (D2*)new char[sizeof (D2)];
    p->d2i = __LINE__;
    sink (p);
  }

  {
    D2 *p = (D2*)new char[3];
    p->d2i = __LINE__;                   // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}


void test_D3 ()
{
  {
    char *p = new char[sizeof (D3)];
    new (p) D3 ();
    sink (p);
  }

  {
    char *p = new char[sizeof (D3) - 1];
    new (p) D3 ();                      // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D3_b0i ()
{
  {
    D3 *p = (D3*)new char[sizeof (D3)];
    p->b0i = __LINE__;
    sink (p);
  }

  {
    D3 *p = (D3*)new char[3];
    p->b0i = __LINE__;                   // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D3_b1i ()
{
  {
    D3 *p = (D3*)new char[sizeof (D3)];
    p->b1i = __LINE__;
    sink (p);
  }

  {
    D3 *p = (D3*)new char[3];
    p->b1i = __LINE__;                   // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D3_b2i ()
{
  {
    D3 *p = (D3*)new char[sizeof (D3)];
    p->b2i = __LINE__;
    sink (p);
  }

  {
    D3 *p = (D3*)new char[3];
    p->b2i = __LINE__;                   // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D3_d1i ()
{
  {
    D3 *p = (D3*)new char[sizeof (D3)];
    p->d1i = __LINE__;
    sink (p);
  }

  {
    D3 *p = (D3*)new char[3];
    p->d1i = __LINE__;                   // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D3_d2i ()
{
  {
    D3 *p = (D3*)new char[sizeof (D3)];
    p->d2i = __LINE__;
    sink (p);
  }

  {
    D3 *p = (D3*)new char[3];
    p->d2i = __LINE__;                   // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D3_d3i ()
{
  {
    D3 *p = (D3*)new char[sizeof (D3)];
    p->d3i = __LINE__;
    sink (p);
  }

  {
    D3 *p = (D3*)new char[3];
    p->d3i = __LINE__;                   // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

void test_D3_d3ax ()
{
  {
    D3 *p = (D3*)new char[sizeof (D3)];
    *p->d3ax = __LINE__;                // { dg-warning "-Warray-bounds" "pr?????" { xfail *-*-* } }
    p->d3ax[9] = __LINE__;              // { dg-warning "-Warray-bounds" "pr?????" { xfail *-*-* } }
    sink (p);
  }

  {
    D3 *p = (D3*)new char[sizeof (D3) + sizeof (D3::d3ax[0])];
    p->d3ax[0] = __LINE__;
    p->d3ax[1] = __LINE__;              // { dg-warning "-Warray-bounds" "pr?????" { xfail *-*-* } }
    sink (p);
  }

  {
    D3 *p = (D3*)new char[3];
    *p->d3ax = __LINE__;                // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

struct D4: D2
{
  // D4:d4a0 overlaps with B0:b0i!
  long d4i, d4a0[0];
};

void test_D4_d3a0 ()
{
  {
    D4 *p = (D4*)new char[sizeof (D4)];
    *p->d4a0 = __LINE__;                // { dg-warning "-Warray-bounds" }
    p->d4a0[1] = __LINE__;              // { dg-warning "-Warray-bounds" }
    p->d4a0[9] = __LINE__;              // { dg-warning "-Warray-bounds" }
    sink (p);
  }

  {
    D4 *p = (D4*)new char[sizeof (D4) + sizeof (D4::d4a0[0])];
    /* The access to d4a0[0] should get a -Wzero-length-bounds because
       it's in bounds but overlaps p->b0i.  */
    p->d4a0[0] = __LINE__;              // { dg-warning "-Wzero-length-bounds" "pr99635" { xfail *-*-* } }
                                        // { dg-warning "-Warray-bounds" "actual" { target *-*-* } .-1 }
    p->d4a0[1] = __LINE__;              // { dg-warning "-Warray-bounds" }
    p->d4a0[9] = __LINE__;              // { dg-warning "-Warray-bounds" }
    sink (p);
  }

  {
    D4 *p = (D4*)new char[3];
    *p->d4a0 = __LINE__;                // { dg-warning "-Warray-bounds" }
    sink (p);
  }
}

Enter:
 
Select:
 

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

Search
  - regexp 

Upload
 
[ ok ]

Make Dir
 
[ ok ]
Make File
 
[ ok ]

Go Dir
 
Go File
 

--[ x2300 Locus7Shell v. 1.0a beta Modded by #!physx^ | www.LOCUS7S.com | Generation time: 0.0057 ]--