Diff Detail
Event Timeline
Please add a CodeGen test.
lib/CodeGen/CGClass.cpp | ||
---|---|---|
1494 | I think remove "_exit" from the name - it can be confused with the program exit. |
lib/CodeGen/CGClass.cpp | ||
---|---|---|
1479 | why not just array with a {} initializer? |
The test should be in CodeGenCXX, and probably called "sanitize-dtor-callback.cpp".
test/CodeGen/sanitize-dtor-usage.cpp | ||
---|---|---|
7 ↗ | (On Diff #29595) | You probably don't need a lot of this code, like main() function, or A() constructor. |
11 ↗ | (On Diff #29595) | remove the comments. |
20 ↗ | (On Diff #29595) | Add a CHECK-LABEL: test for the function name to make sure the call is in the destructor. You'll probably need -triple=x86_64-pc-linux in the run line so that destructor name mangling is consistent. |
22 ↗ | (On Diff #29595) | This does not do anything because of --check-prefix=DTOR (CHECK is the default prefix that is disabled if you set some other prefix). Add --check-prefix=CHECK. Test that the function call is not added when building without -fsanitize-memory-use-after-dtor. |
lib/CodeGen/CGClass.cpp | ||
---|---|---|
1479 | Would you mind factoring this out to a helper function? Most readers of clang irgen probably aren't interested in this instrumentation. |
lib/CodeGen/CGClass.cpp | ||
---|---|---|
1482 | Remove the size of the array here. For instance, if you reduce the number of elements, the code would still compile, but the array would have trailing nullptrs. |
memory-poisoning