Thanks to the wonders of UB, the sample on the article when compiled with optimization on, it actually reduces to,
//clang -o null_dereference null_dereference.c
#include <stdio.h>
int main() {
int *ptr = NULL; // Initialize a pointer to NULL
int value = *ptr; // Attempt to dereference the NULL pointer
printf("Value: %d\n", value); // This line will reached, because the previous will be optimized away.
return 0;
}
Example, https://godbolt.org/z/Kv3rcz1ch