Skip to content
Commit 8580cd4e authored by Craig Topper's avatar Craig Topper
Browse files

[ValueTracking] Avoid undefined behavior in unittest by not making a named...

[ValueTracking] Avoid undefined behavior in unittest by not making a named ArrayRef from a std::initializer_list

One of the ValueTracking unittests creates a named ArrayRef initialized by a std::initializer_list. The underlying array for an std::initializer_list is only guaranteed to have a lifetime as long as the initializer_list object itself. So this can leave the ArrayRef pointing at an array that no long exists.

This fixes this to just create an explicit array instead of an ArrayRef.

Differential Revision: https://reviews.llvm.org/D32089

llvm-svn: 300354
parent c22c7b14
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment