Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.31 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. cat > wtf.cc <<EOF
  4. struct B { B() {} B(int) {} };
  5. B crash() { return B(); }
  6. int main(int argc, char** argv) { }
  7. EOF
  8.  
  9. g++ -O0 -g -c wtf.cc -o wtf.o
  10. g++ -o wtf wtf.o
  11.  
  12. { gdb --args wtf > /dev/null <<EOF
  13. break main
  14. run
  15. p crash()
  16. EOF
  17. } 2> /dev/null && echo ok || echo FAIL
  18.  
  19. rm wtf.cc wtf.o wtf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement