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 | 6d69fd1fe378077aa99505af9cd0a64553d5df57 (patch) | |
| tree | dab7d34f6c00033b748b27c53907dab351d2f109 /src | |
| parent | a267ff6a815ce9f8f92f9bcb41cc53f6ebae122a (diff) | |
| download | go-6d69fd1fe378077aa99505af9cd0a64553d5df57.tar.xz | |
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 #710.
R=gri
CC=esko.luontola, golang-dev
https://golang.org/cl/887043
Diffstat (limited to 'src')
| -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 fd0b36c6eb..eb4b69a2e7 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 9a027d430e..c2eee60ca4 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; |
