[PATCH] [RFC] Sanitize upcasts and conversion to virtual base

Richard Smith richard at metafoo.co.uk
Tue Oct 7 17:36:38 PDT 2014


================
Comment at: tools/clang/lib/CodeGen/CGClass.cpp:186
@@ +185,3 @@
+      EmitTypeCheck(TCK_Upcast, Loc, Value, DerivedTy, DerivedAlign,
+                    !NullCheckValue);
+    }
----------------
I am not sure that the `SkipNullCheck` behavior here is right. If `NullCheckValue` is false, then I think we should be performing a null check inside `EmitTypeCheck` rather than assuming the pointer is non-null.

http://reviews.llvm.org/D5635






More information about the cfe-commits mailing list