From: Russ Cox Date: Tue, 2 Sep 2014 18:36:25 +0000 (-0400) Subject: cmd/gc: fix runtime print(hex(x)) X-Git-Tag: go1.4beta1~577 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8e89f87158eb364330e4334d7084e290e07c66a8;p=gostls13.git cmd/gc: fix runtime print(hex(x)) The code I wrote originally works for trivial functions that are inlined at a call site in another package, because that was how I wrote my local test. Make hex(x) work for non-inlinable functions too. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews, r https://golang.org/cl/140830043 --- diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c index 26d8011240..30c139200b 100644 --- a/src/cmd/gc/walk.c +++ b/src/cmd/gc/walk.c @@ -1838,7 +1838,7 @@ walkprint(Node *nn, NodeList **init, int defer) } } else { if(et == TUINT64) { - if(t->sym->pkg == runtimepkg && strcmp(t->sym->name, "hex") == 0) + if((t->sym->pkg == runtimepkg || compiling_runtime) && strcmp(t->sym->name, "hex") == 0) on = syslook("printhex", 0); else on = syslook("printuint", 0);