Guest User

Untitled

a guest
Nov 24th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. // Throwing Function
  2. void throwing() __asm__("throwing");
  3. void throwing() {
  4. throw "abc";
  5. }
  6.  
  7. // Assembly function which calls throwing()
  8. void asm_call() {
  9. __asm__ __volatile__ (
  10. "call throwingn"
  11. );
  12. }
  13.  
  14. // Main calls the assembly function in a try block
  15. int main() {
  16. try {
  17. asm_call();
  18. } catch (...) {
  19. std::cout << "caught..." << std::endl;
  20. }
  21.  
  22. return 0;
  23. }
Add Comment
Please, Sign In to add comment