From 57154e33c8acfbe3efeb5a3b06fbb48166b591a2 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Fri, 21 Feb 2020 18:49:02 -0600 Subject: [PATCH] warn about misidentified generic pointers update structures --- library/xml | 2 +- plugins/devel/check-structures-sanity.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/library/xml b/library/xml index 6dcfd4210..874ad8936 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 6dcfd4210cbffb71127f8dd8eef170e149990d40 +Subproject commit 874ad8936e9f29cd616d76ebdc93fef958ded379 diff --git a/plugins/devel/check-structures-sanity.cpp b/plugins/devel/check-structures-sanity.cpp index 0905ebea0..a984c0745 100644 --- a/plugins/devel/check-structures-sanity.cpp +++ b/plugins/devel/check-structures-sanity.cpp @@ -560,14 +560,17 @@ bool Checker::maybe_queue_tagged_union(const ToCheck & item, const struct_field_ void Checker::check_dispatch(const ToCheck & item) { - if (!item.identity) + if (reinterpret_cast(item.ptr) == UNINIT_PTR) { + // allow uninitialized raw pointers return; } - if (reinterpret_cast(item.ptr) == UNINIT_PTR) + if (!item.identity) { - // allow uninitialized raw pointers + // warn about bad pointers + check_access(item, item.ptr, df::identity_traits::get(), 1); + return; }