view libmudflap/testsuite/libmudflap.c++/pass28-frag.cxx @ 32:59194914942b

add documents. CbC-INSTALL: howto build the gcc for various systems. CbC-implementation.ja: methods of implementation for CbC's statement.
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Tue, 08 Dec 2009 14:07:28 +0900
parents a06113de4d67
children
line wrap: on
line source

class foo {
  char z [10];
public:
  virtual char *get_z () { return & this->z[0]; }
};

class bar: public foo {
  char q [20];
public:
  char *get_z () { return & this->q[0]; }
};

int main () {
foo *x = new bar ();

x->get_z()[9] = 'a';

delete x;
return 0;
}