Open Bug 1872197 Opened 2 years ago Updated 2 years ago

[hazards] calls to lambda functions can be aliased

Categories

(Core :: JavaScript: GC, defect, P3)

defect

Tracking

()

People

(Reporter: sfink, Unassigned)

References

(Blocks 1 open bug)

Details

template <typename Function>
void Call(Function&& f) {
  f();
}
.
.
.
void function_pointers() {
  Call([]() { printf("First lambda\n"): });
  Call([]() { printf("Second lambda\n"): });
}

There are two specialized instances of the Call function here, which sixgill distinguishes, but the invocations of f within the two look identical in the sixgill output. It's not a fundamental problem; the information to distinguish them is present. But both look like source.cpp:void function_pointers()::<lambda()> where source.cpp is the filename, and function_pointers() is the name of the function where the lambdas syntactically appear.

The specialized Call instances have names like:

source.cpp:void Call1(_Z17function_pointersv::__lambda0&&) [with Function = function_pointers()::<lambda()>]
source.cpp:void Call2(_Z27annotated_function_pointersv::__lambda1&&) [with Function = annotated_function_pointers()::<lambda()>]

which shows that the compiler is numbering the lambdas, which is what we want. But the function-scoped and numbered names of the lambdas are not used for the call within the body of the templatized function.

This is using gcc's builtin mechanism for fetching the name of a function, so it's not a simple matter of adding smarts to sixgill. It may require detecting and customizing the function name generation for lambda calls.

Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.