Self-Supervised Bug Detection and Repair