Skip to content

Instantly share code, notes, and snippets.

@sunho
Last active April 30, 2022 23:31
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 sunho/ba6784608329df6dcc4953aff863f88c to your computer and use it in GitHub Desktop.
Save sunho/ba6784608329df6dcc4953aff863f88c to your computer and use it in GitHub Desktop.
#include <iostream>
#define ISSUE
int main(){
#ifdef ISSUE
std::ios_base::sync_with_stdio(true);
#else
std::ios_base::sync_with_stdio(false);
#endif
const std::ostream::sentry sentry1(std::cout);
if (sentry1) {
printf("ok\n");
}
return 0;
}
// The segmentation fault when ISSUE is defined
// Commands:
// clang++ -c -fPIC hello.cpp -o hello.o
// llvm-jitlink hello.o
// Enviroment:
// Linux 5.13.0-39-generic #44~20.04.1-Ubuntu SMP Thu Mar 24 16:43:35 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment