2 // Bug: We were assuming that the return slot of the current function is
3 // always safe to use as the return slot for another call, because its
4 // address cannot escape. But its address can escape if we perform the
5 // named return value optimization.
11 A( int left, int top, int width, int height )
12 : x1(left), y1(top), x2(left+width-1), y2(top+height-1) {}
14 //A(const A& o) : x1(o.x1), y1(o.y1), x2(o.x2), y2(o.y2) {}
15 //A& operator=(const A& o ) { x1=o.x1; y1=o.y1; x2=o.x2; y2=o.y2; return *this; }
17 A operator&(const A &r) const
20 tmp.x1 = ((r.x1) < (x1) ? (x1) : (r.x1));
21 tmp.x2 = ((x2) < (r.x2) ? (x2) : (r.x2));
22 tmp.y1 = ((r.y1) < (y1) ? (y1) : (r.y1));
23 tmp.y2 = ((y2) < (r.y2) ? (y2) : (r.y2));
33 bool operator==( const A &r1, const A &r2 )
35 return r1.x1==r2.x1 && r1.x2==r2.x2 && r1.y1==r2.y1 && r1.y2==r2.y2;
40 A all = A( 0, 0, 1024, 768);
47 extern "C" void abort(void);
49 int main( int argc, char ** argv )
51 A all = A( 0, 0, 1024, 768);