Fix two more issues with r356652
authorPavel Labath <pavel@labath.sk>
Thu, 21 Mar 2019 10:21:55 +0000 (10:21 +0000)
committerPavel Labath <pavel@labath.sk>
Thu, 21 Mar 2019 10:21:55 +0000 (10:21 +0000)
commit045b8544fd2c4e14f7e72e0df2bc681d823b0838
treeba4382bfbeb68c2a72ac25d28eb80baa17068243
parent0a9541e9ed3fa44fcd36dbbb3fce4deb147d5688
Fix two more issues with r356652

The first problem was a use-after-free in the tests (detected by asan
bots). The temporary array created for the "create" call is guaranteed
to live only until the end of the statement. The fix there is to store
the test data in a local variable to ensure it has the right lifetime

The second issue is broken BUILD_SHARED_LIBS build, which I fix by
adding the appropriate BinaryFormat dependency to the Object unit tests.

llvm-svn: 356655
llvm/unittests/Object/CMakeLists.txt
llvm/unittests/Object/MinidumpTest.cpp