1 //===-- main2.c -------------------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 #include <stdio.h> 9 #include <stdlib.h> 10 11 int main(int argc, const char* argv[]) 12 { 13 int *int_ptr = (int *)malloc(sizeof(int)); 14 *int_ptr = 7; 15 printf("Hello, world!\n"); 16 printf("Now not crash %d\n", *int_ptr); // Not crash here. 17 } 18