dougbinks / enkiTS

A permissively licensed C and C++ Task Scheduler for creating parallel programs. Requires C++11 support.
zlib License
1.66k stars 138 forks source link

Address Sanitizer finding #125

Closed erincatto closed 2 months ago

erincatto commented 2 months ago

I've been doing more sanitizer runs and hit another issue. There are calls to GetConfig() that return a structure by value and then code is taking reference to a member of that structure. This is a reference to a temporary variable that is out of scope.

There are several of these:

const CustomAllocator& customAllocator = pETS_->GetConfig().customAllocator;

I tried a simple fix:

CustomAllocator customAllocator = pETS_->GetConfig().customAllocator;

And this made ASAN happy.

I can submit a PR if you like.

dougbinks commented 2 months ago

Thanks for this issue report - I'm happy to receive a PR if you want your name in the commit log, but I'm equally happy just to make the change myself.