Diff Detail
Event Timeline
Please add a CodeGen test.
lib/CodeGen/CGClass.cpp | ||
---|---|---|
1471 | I think remove "_exit" from the name - it can be confused with the program exit. |
lib/CodeGen/CGClass.cpp | ||
---|---|---|
1456 | 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 | You probably don't need a lot of this code, like main() function, or A() constructor. | |
11 | remove the comments. | |
20 | 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 | 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 | ||
---|---|---|
1456 | 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 | ||
---|---|---|
1459 | 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