-
-
Save andrey-malets/b70b0119bdbb92fb4025 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
malets@ub:~$ cat 1.C | |
#include <cstdlib> | |
struct C { | |
int *ptr; | |
int& operator*() { | |
return *ptr; | |
} | |
}; | |
int main(void) { | |
C o = {NULL}; | |
return &*o == NULL; | |
} | |
malets@ub:~$ clang++ -fsanitize=undefined -o 1 1.C && ./1 | |
==397678==WARNING: Trying to symbolize code, but external symbolizer is not initialized! | |
1.C:7:12: runtime error: reference binding to null pointer of type 'int' | |
malets@ub:~$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment