Files
carbon-lang/executable_semantics/testdata/undef2.6c
T

14 lines
307 B
Plaintext

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// Use-after-free.
fun main() -> Int {
var Ptr(int): p;
p = malloc(Int);
*p = 0;
free(p);
return *p;
}