Advertisement
Swiftkill

CrashLoop

Jan 27th, 2019
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #if LL_WINDOWS
  2. // VC80 was optimizing the error away.
  3. #pragma optimize("", off)
  4. #endif
  5. void crashAndLoop(const std::string& message)
  6. {
  7. #ifdef CWDEBUG
  8. DoutFatal(dc::core, message);
  9. #else
  10. // Now, we go kaboom!
  11. int* make_me_crash = NULL;
  12.  
  13. *make_me_crash = 0;
  14.  
  15. while(true)
  16. {
  17. // Loop forever, in case the crash didn't work?
  18. }
  19.  
  20. // this is an attempt to let Coverity and other semantic scanners know that this function won't be returning ever.
  21. exit(EXIT_FAILURE);
  22. #endif
  23. }
  24. #if LL_WINDOWS
  25. #pragma optimize("", on)
  26. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement