This scheme checks that pointer and lvalue casts are made to an object of
the correct dynamic type; that is, the dynamic type of the object must be
a derived class of the pointee type of the cast. The checks are currently
only introduced where the class being casted to is a polymorphic class.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
| docs/UsersManual.rst | ||
|---|---|---|
| 974 ↗ | (On Diff #21898) | Add -fsanitize=cfi-cast-strict? |
| lib/CodeGen/CGClass.cpp | ||
| 2121 ↗ | (On Diff #21898) | Why? |
| test/CodeGenCXX/cfi-cast.cpp | ||
| 4 ↗ | (On Diff #21898) | Could you have a quick blurb that helps decipher the metadata !"1B' part, explaining that it's the important bit in the checks. |
| 15 ↗ | (On Diff #21898) | CHECK-LABEL-DCAST (same below). |
| 77 ↗ | (On Diff #21898) | Add rvalue ref test? A a();
B rvalue() {
return static_cast<B&&>(a());
} |
Comment Actions
Please also add compiler-rt test(s)
| docs/UsersManual.rst | ||
|---|---|---|
| 971 ↗ | (On Diff #21898) | Don't we want more verbose names? |
Comment Actions
Please also add compiler-rt test(s)
Will do
| docs/UsersManual.rst | ||
|---|---|---|
| 971 ↗ | (On Diff #21898) | Okay, I've given these better names. |
| 974 ↗ | (On Diff #21898) | Done. |
| lib/CodeGen/CGClass.cpp | ||
| 2121 ↗ | (On Diff #21898) | Explained in comment. |
| test/CodeGenCXX/cfi-cast.cpp | ||
| 4 ↗ | (On Diff #21898) | Done |
| 15 ↗ | (On Diff #21898) | Done |
| 77 ↗ | (On Diff #21898) | Done. |
Comment Actions
lgtm after what seems like a typo.
| test/CodeGenCXX/cfi-cast.cpp | ||
|---|---|---|
| 58 ↗ | (On Diff #21967) | B&& |