Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

modernize-pass-by-value causes access violation (LLVM 11.1.0) #48330

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR49361
Status NEW
Importance P normal
Reported by Florian Gross (fgross@noexcept.net)
Reported on 2021-02-26 02:33:16 -0800
Last modified on 2021-02-26 02:33:16 -0800
Version unspecified
Hardware PC Windows NT
CC alexfh@google.com, djasper@google.com, klimek@google.com
Fixed by commit(s)
Attachments CallStack.txt (2900 bytes, text/plain)
Blocks
Blocked by
See also
Created attachment 24575
Visual Studio Call Stack

I'm building clang-tidy 11.1.0 on Windows using VS2017, 32-bit and with enabled
LTCG.

clang-tidy crashes with an access violation on almost any file as soon as
"modernize-pass-by-value" is enabled. This happens even with a totally empty
file:

clang-tidy "-config={Checks: '-*,modernize-pass-by-value'}" empty.cpp

The crash only occurs in Release configuration with LTCG enabled. I know LTCG
is not enabled in the repository, my guess is there is some bug that only
happens to be detected in this specific configuration.

Find attached the best call stack I could get from Visual Studio.

The "cxxCtorInitializer" matcher is used in the method
"PassByValueCheck::registerMatchers" (clang-
tidy\modernize\PassByValueCheck.cpp). If I remove all the nested matchers from
this expression, the access violation disappears. So it is somehow related to
this code, but I don't see any obvious errors in there.
Quuxplusone commented 3 years ago

Attached CallStack.txt (2900 bytes, text/plain): Visual Studio Call Stack