summaryrefslogtreecommitdiff
path: root/src/cmd/gc/subr.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2013-08-15 14:38:32 -0400
committerRuss Cox <rsc@golang.org>2013-08-15 14:38:32 -0400
commit999a36f9afe858f1928e5ea74b2d9b41c9090873 (patch)
tree04098dbf3e033479ecc2d93c01c95b6487c048fd /src/cmd/gc/subr.c
parent5ce78b7cd281b187a06dcdb9ea9d1de8419db297 (diff)
downloadgo-git-999a36f9afe858f1928e5ea74b2d9b41c9090873.tar.gz
cmd/gc: &x panics if x does
See golang.org/s/go12nil. This CL is about getting all the right checks inserted. A followup CL will add an optimization pass to remove redundant checks. R=ken2 CC=golang-dev https://golang.org/cl/12970043
Diffstat (limited to 'src/cmd/gc/subr.c')
-rw-r--r--src/cmd/gc/subr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c
index d828c784b0..2f617ac9d0 100644
--- a/src/cmd/gc/subr.c
+++ b/src/cmd/gc/subr.c
@@ -3769,7 +3769,7 @@ isbadimport(Strlit *path)
}
void
-checknotnil(Node *x, NodeList **init)
+checknil(Node *x, NodeList **init)
{
Node *n;
@@ -3777,7 +3777,7 @@ checknotnil(Node *x, NodeList **init)
x = nod(OITAB, x, N);
typecheck(&x, Erv);
}
- n = nod(OCHECKNOTNIL, x, N);
+ n = nod(OCHECKNIL, x, N);
n->typecheck = 1;
*init = list(*init, n);
}