From 8e89f87158eb364330e4334d7084e290e07c66a8 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 2 Sep 2014 14:36:25 -0400 Subject: [PATCH] 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 --- src/cmd/gc/walk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.48.1