mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:34:45 +01:00
improve abstraction for AssocList, fix bug in optional else (#315)
* improve abstraction for AssocList, fix bug in optional else * add flag for tracing output, clean up code for output * turned off tracing by default, updated goldens, removed two examples that use pointers, shouldn't have been there yet
This commit is contained in:
-18
@@ -1,18 +0,0 @@
|
||||
// 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
|
||||
|
||||
// The behavior of this program is undefined because it tries to
|
||||
// access a local variable after its lifetime is over.
|
||||
|
||||
fn f() -> Int* {
|
||||
var int: x;
|
||||
x = 0;
|
||||
return &x;
|
||||
}
|
||||
|
||||
fn main() -> int {
|
||||
var Ptr(int): p;
|
||||
p = f();
|
||||
return *p;
|
||||
}
|
||||
Reference in New Issue
Block a user