Aleks11

Hack of C++ compiler

Oct 30th, 2013
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. int *func()
  2. {
  3.     //return nullptr;
  4.     return new int(3);
  5. }
  6.  
  7. int main()
  8. {
  9.     int *pi = func();
  10.  
  11.     if (pi)
  12.         goto ok;
  13.  
  14.     goto fail;
  15.  
  16. ok:
  17.     int &tt = *pi;
  18.  
  19. fail:
  20.     tt = 20;
  21.  
  22.     if (pi)
  23.         delete pi;
  24.  
  25.     _getch();
  26.     return 0;
  27. }
Add Comment
Please, Sign In to add comment