]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/ld, runtime: clean up CL 9666047
authorRuss Cox <rsc@golang.org>
Mon, 3 Jun 2013 20:44:35 +0000 (16:44 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 3 Jun 2013 20:44:35 +0000 (16:44 -0400)
Remove unnecessary ( ) around == in && clause.
Add { } around multiline if body, even though it's one statement.

Add runtime: prefix to printed errors.

R=cshapiro, iant
CC=golang-dev
https://golang.org/cl/9685047

src/cmd/ld/lib.c
src/pkg/runtime/symtab.c

index 88c9f6a6074e66137a34b7f1f4c30890c4aef461..7084debcc091d36938e6cebe612724c14d8880be 100644 (file)
@@ -1914,13 +1914,13 @@ genasmsym(void (*put)(Sym*, char*, int, vlong, vlong, int, Sym*))
                /* frame, locals, args, auto, param and pointers after */
                put(nil, ".frame", 'm', (uint32)s->text->to.offset+PtrSize, 0, 0, 0);
                put(nil, ".locals", 'm', s->locals, 0, 0, 0);
-               if((s->text->textflag & NOSPLIT) && (s->args == 0) && (s->nptrs < 0))
+               if((s->text->textflag & NOSPLIT) && s->args == 0 && s->nptrs < 0) {
                        // This might be a vararg function and have no
                        // predetermined argument size.  This check is
                        // approximate and will also match 0 argument
                        // nosplit functions compiled by 6c.
                        put(nil, ".args", 'm', ArgsSizeUnknown, 0, 0, 0);
-               else
+               else
                        put(nil, ".args", 'm', s->args, 0, 0, 0);
                if(s->nptrs >= 0) {
                        put(nil, ".nptrs", 'm', s->nptrs, 0, 0, 0);
index 126d0c52041e10e7c95b067a22e8c5867de55780..461707b98ed1ca40377ca602d73604c6109a773e 100644 (file)
@@ -204,7 +204,7 @@ dofunc(Sym *sym)
                if(runtime·strcmp(sym->name, (byte*)"etext") == 0)
                        break;
                if(sym->value < lastvalue) {
-                       runtime·printf("symbols out of order: %p before %p\n", lastvalue, sym->value);
+                       runtime·printf("runtime: symbols out of order: %p before %p\n", lastvalue, sym->value);
                        runtime·throw("malformed symbol table");
                }
                lastvalue = sym->value;
@@ -230,7 +230,7 @@ dofunc(Sym *sym)
                else if(runtime·strcmp(sym->name, (byte*)".nptrs") == 0) {
                        // TODO(cshapiro): use a dense representation for gc information
                        if(sym->value != func[nfunc-1].args/sizeof(uintptr)) {
-                               runtime·printf("pointer map size and argument size disagree\n");
+                               runtime·printf("runtime: pointer map size and argument size disagree\n");
                                runtime·throw("mangled symbol table");
                        }
                        cap = ROUND(sym->value, 32) / 32;
@@ -239,12 +239,12 @@ dofunc(Sym *sym)
                        func[nfunc-1].ptrs.cap = cap;
                } else if(runtime·strcmp(sym->name, (byte*)".ptrs") == 0) {
                        if(func[nfunc-1].ptrs.len >= func[nfunc-1].ptrs.cap) {
-                               runtime·printf("more pointer map entries read than argument words\n");
+                               runtime·printf("runtime: more pointer map entries read than argument words\n");
                                runtime·throw("mangled symbol table");
                        }
                        ((uint32*)func[nfunc-1].ptrs.array)[func[nfunc-1].ptrs.len++] = sym->value;
                } else {
-                       runtime·printf("invalid '%c' symbol named '%s'\n", (int8)sym->symtype, sym->name);
+                       runtime·printf("runtime: invalid '%c' symbol named '%s'\n", (int8)sym->symtype, sym->name);
                        runtime·throw("mangled symbol table");
                }
                break;