Commit 24192bbd authored by Lucio De Re's avatar Lucio De Re Committed by Ian Lance Taylor

libbio, libmach: warnings from the Plan 9 tool chain

Superficial inconsistencies that trigger warnings in
Plan 9.  Small enough to be considered trivial and
seemingly benign outside of the Plan 9 environment.

LGTM=iant
R=golang-codereviews, 0intro, iant
CC=golang-codereviews
https://golang.org/cl/73460043
parent 8076f21e
......@@ -73,7 +73,7 @@ struct Biobuf
* next few bytes in little-endian order.
*/
#define BGETC(bp)\
((bp)->icount?(bp)->ebuf[(bp)->icount++]:Bgetc((bp)))
((bp)->icount?(int)((bp)->ebuf[(bp)->icount++]):Bgetc((bp)))
#define BGETLE2(bp)\
((bp)->icount<=-2?((bp)->icount+=2,((bp)->ebuf[(bp)->icount-2])|((bp)->ebuf[(bp)->icount-1]<<8)):Bgetle2((bp)))
#define BGETLE4(bp)\
......
......@@ -36,7 +36,8 @@ Bputrune(Biobuf *bp, long c)
rune = (Rune)c;
if(rune < Runeself) {
BPUTC(bp, (int)rune);
n = BPUTC(bp, (int)rune);
USED(n);
return 1;
}
n = runetochar(str, &rune);
......
......@@ -195,33 +195,36 @@ i386trace(Map *map, uvlong pc, uvlong sp, uvlong link, Tracer trace)
break;
if(s.value == morestack) {
// This code is old and won't work anymore.
// But no one uses it anyway.
// Leave it obviously broken until someone needs it.
werrstr("morestack not implemented correctly");
return -1;
// In the middle of morestack.
// Caller is m->morepc.
// Caller's caller is in m->morearg.
// TODO(rsc): 386
geta(map, offsetof(struct UregAmd64, r14), &m);
pc = 0;
sp = 0;
pc1 = 0;
s1 = s;
memset(&s, 0, sizeof s);
geta(map, m+1*mach->szaddr, &pc1); // m->morepc
geta(map, m+2*mach->szaddr, &sp); // m->morebuf.sp
geta(map, m+3*mach->szaddr, &pc); // m->morebuf.pc
findsym(pc1, CTEXT, &s);
(*trace)(map, pc1, sp-mach->szaddr, &s1); // morestack symbol; caller's PC/SP
// caller's caller
s1 = s;
findsym(pc, CTEXT, &s);
(*trace)(map, pc, sp, &s1); // morestack's caller; caller's caller's PC/SP
continue;
if (0) {
// This code is old and won't work anymore.
// But no one uses it anyway.
// Leave it obviously broken until someone needs it.
// In the middle of morestack.
// Caller is m->morepc.
// Caller's caller is in m->morearg.
// TODO(rsc): 386
geta(map, offsetof(struct UregAmd64, r14), &m);
pc = 0;
sp = 0;
pc1 = 0;
s1 = s;
memset(&s, 0, sizeof s);
geta(map, m+1*mach->szaddr, &pc1); // m->morepc
geta(map, m+2*mach->szaddr, &sp); // m->morebuf.sp
geta(map, m+3*mach->szaddr, &pc); // m->morebuf.pc
findsym(pc1, CTEXT, &s);
(*trace)(map, pc1, sp-mach->szaddr, &s1); // morestack symbol; caller's PC/SP
// caller's caller
s1 = s;
findsym(pc, CTEXT, &s);
(*trace)(map, pc, sp, &s1); // morestack's caller; caller's caller's PC/SP
continue;
} else {
werrstr("morestack not implemented correctly");
return -1;
}
}
if(pc == lessstack) {
......
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