Preprocessor class can own and free resources in its destructor, but
doesn't have user-written copy constructor or assignment operator, hence
any copy attempt will use compiler-generated copy constructor and may
cause use-after-free problems.
Details
- Reviewers
aaron.ballman tahonermann schittir
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'm not opposed, but the copy ctor and copy assignment operators are already deleted by default in this case (e.g., the class has data members with deleted copy constructors). So I agree this is an NFC change, but there's no bug being fixed which makes me think this should go back to the static analysis vendor to report this as a false positive.
there's no bug being fixed which makes me think this should go back to the static analysis vendor to report this as a false positive.
I agree. I'll try to isolate a reproducible test case and report it to the vendor.
I agree. I'll try to isolate a reproducible test case and report it to the vendor.
Done.
I'm ambivalent with regard to keeping or discarding the proposed change, but the static analysis issue should be triaged as a false positive.
Oh shoot, I trusted the tool too much to not double check that the copy ctor is already deleted. Thank you for the catch and for the bug report.
I'll abandon this change then.