Guest User

Untitled

a guest
Jan 24th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. void foo()
  2. {
  3. if (!doA())
  4. goto exit;
  5. if (!doB())
  6. goto cleanupA;
  7. if (!doC())
  8. goto cleanupB;
  9.  
  10. /* everything has succeeded */
  11. return;
  12.  
  13. cleanupB:
  14. undoB();
  15. cleanupA:
  16. undoA();
  17. exit:
  18. return;
  19. }
Add Comment
Please, Sign In to add comment