From 06caa02ccf41c3d32fb9e4cb91ebbd2daeda40ce Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 3 Feb 2016 06:54:41 +0000 Subject: compiler, runtime: mark stub methods, ignore them in runtime.Caller. This fixes the long-standing bug in which the testing package misreports the file/line of an error. Reviewed-on: https://go-review.googlesource.com/19179 From-SVN: r233098 --- libgo/runtime/go-callers.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libgo') diff --git a/libgo/runtime/go-callers.c b/libgo/runtime/go-callers.c index b5ab3be..0c1c603 100644 --- a/libgo/runtime/go-callers.c +++ b/libgo/runtime/go-callers.c @@ -74,6 +74,8 @@ callback (void *data, uintptr_t pc, const char *filename, int lineno, p = __builtin_strrchr (function, '$'); if (p != NULL && __builtin_strcmp(p, "$recover") == 0) return 0; + if (p != NULL && __builtin_strncmp(p, "$stub", 5) == 0) + return 0; } if (arg->skip > 0) -- cgit v1.1