Commit 8e89f871 authored by Russ Cox's avatar Russ Cox

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
parent 6baf173b
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment