diff options
author | Russ Cox <rsc@golang.org> | 2010-04-05 23:36:37 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-04-05 23:36:37 -0700 |
commit | a07561b4c0ff65ddda3976b2f8b9cb530095bd75 (patch) | |
tree | 5c150c19dd2ebe33292706846c2a9bfd6c8698c6 | |
parent | 2229d844f9e2214676e486d54e9deae6ee7f7ed3 (diff) | |
download | golang-a07561b4c0ff65ddda3976b2f8b9cb530095bd75.tar.gz |
runtime: fix Caller
log: add test of Caller
New regexp in log test is picky and will require some
maintenance, but it catches off-by-one mistakes too.
Fixes issue 710.
R=gri
CC=esko.luontola, golang-dev
http://codereview.appspot.com/887043
-rw-r--r-- | src/pkg/log/log_test.go | 2 | ||||
-rw-r--r-- | src/pkg/runtime/runtime.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/log/log_test.go b/src/pkg/log/log_test.go index fd0b36c6e..eb4b69a2e 100644 --- a/src/pkg/log/log_test.go +++ b/src/pkg/log/log_test.go @@ -17,7 +17,7 @@ const ( Rdate = `[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]` Rtime = `[0-9][0-9]:[0-9][0-9]:[0-9][0-9]` Rmicroseconds = `\.[0-9][0-9][0-9][0-9][0-9][0-9]` - Rline = `[0-9]+:` + Rline = `(58|60):` // must update if the calls to l.Logf / l.Log below move Rlongfile = `.*/[A-Za-z0-9_\-]+\.go:` + Rline Rshortfile = `[A-Za-z0-9_\-]+\.go:` + Rline ) diff --git a/src/pkg/runtime/runtime.c b/src/pkg/runtime/runtime.c index 9a027d430..c2eee60ca 100644 --- a/src/pkg/runtime/runtime.c +++ b/src/pkg/runtime/runtime.c @@ -479,7 +479,7 @@ void { Func *f; - if(callers(skip, &retpc, 1) == 0 || (f = findfunc(retpc-1)) == nil) { + if(callers(1+skip, &retpc, 1) == 0 || (f = findfunc(retpc-1)) == nil) { retfile = emptystring; retline = 0; retbool = false; |