Skip to content

Instantly share code, notes, and snippets.

@thestinger
Created March 3, 2019 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thestinger/1398ddadade182bcdb43e1caa74220c8 to your computer and use it in GitHub Desktop.
Save thestinger/1398ddadade182bcdb43e1caa74220c8 to your computer and use it in GitHub Desktop.
// clang -std=c99 -O2 foo.c && ./a.out
#include <stdio.h>
#include <stdbool.h>
__attribute__((noinline)) void foo(bool b) {
if (b) return; // remove this line and it will infinite loop
while (1) {}
}
int main() {
foo(false);
puts("broken!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment