Skip to content

Commit

Permalink
liblink: code for debugging bad returns
Browse files Browse the repository at this point in the history
Disabled by default, but invaluable when you need it.

Change-Id: If4a75d11d14f70b6840d339aaec4b940dc406493
Reviewed-on: https://go-review.googlesource.com/2012
Reviewed-by: Russ Cox <[email protected]>
  • Loading branch information
aclements committed Dec 22, 2014
1 parent e7173df commit 6c78443
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/liblink/obj9.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,22 @@ addstacksplit(Link *ctxt, LSym *cursym)
p->link = q;
p = q;

if(0) {
// Debug bad returns
q = ctxt->arch->prg();
q->as = AMOVD;
q->lineno = p->lineno;
q->from.type = D_OREG;
q->from.offset = 0;
q->from.reg = REGTMP;
q->to.type = D_REG;
q->to.reg = REGTMP;

q->link = p->link;
p->link = q;
p = q;
}

if(autosize) {
q = ctxt->arch->prg();
q->as = AADD;
Expand Down

0 comments on commit 6c78443

Please sign in to comment.