Commit 06caa02c by Ian Lance Taylor

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
parent e2bd26b7
a408bef550251926c28673818db2c64302faac1d c70e74c116d08c6f2e787551eb1366983815c032
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -9632,13 +9632,14 @@ Type::build_stub_methods(Gogo* gogo, const Type* type, const Methods* methods, ...@@ -9632,13 +9632,14 @@ Type::build_stub_methods(Gogo* gogo, const Type* type, const Methods* methods,
package = NULL; package = NULL;
else else
package = type->named_type()->named_object()->package(); package = type->named_type()->named_object()->package();
std::string stub_name = name + "$stub";
Named_object* stub; Named_object* stub;
if (package != NULL) if (package != NULL)
stub = Named_object::make_function_declaration(name, package, stub = Named_object::make_function_declaration(stub_name, package,
stub_type, location); stub_type, location);
else else
{ {
stub = gogo->start_function(name, stub_type, false, stub = gogo->start_function(stub_name, stub_type, false,
fntype->location()); fntype->location());
Type::build_one_stub_method(gogo, m, buf, stub_params, Type::build_one_stub_method(gogo, m, buf, stub_params,
fntype->is_varargs(), location); fntype->is_varargs(), location);
......
...@@ -74,6 +74,8 @@ callback (void *data, uintptr_t pc, const char *filename, int lineno, ...@@ -74,6 +74,8 @@ callback (void *data, uintptr_t pc, const char *filename, int lineno,
p = __builtin_strrchr (function, '$'); p = __builtin_strrchr (function, '$');
if (p != NULL && __builtin_strcmp(p, "$recover") == 0) if (p != NULL && __builtin_strcmp(p, "$recover") == 0)
return 0; return 0;
if (p != NULL && __builtin_strncmp(p, "$stub", 5) == 0)
return 0;
} }
if (arg->skip > 0) if (arg->skip > 0)
......
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