diff mbox series

[2/5] add ptr_ctype_noderef for use with prinft code

Message ID 20181029153952.13927-3-ben.dooks@codethink.co.uk (mailing list archive)
State Superseded, archived
Headers show
Series [1/5] tokenize: check show_string() for NULL pointer | expand

Commit Message

Ben Dooks Oct. 29, 2018, 3:39 p.m. UTC
Add a specific type for a pointer that shouldn't be dereferenced.
This is used by the printf format parser for the %p case.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 symbol.c | 4 +++-
 symbol.h | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/symbol.c b/symbol.c
index 26906ec..b1e7db1 100644
--- a/symbol.c
+++ b/symbol.c
@@ -674,7 +674,8 @@  struct symbol	bool_ctype, void_ctype, type_ctype,
 		llong_ctype, sllong_ctype, ullong_ctype,
 		lllong_ctype, slllong_ctype, ulllong_ctype,
 		float_ctype, double_ctype, ldouble_ctype,
-		string_ctype, ptr_ctype, lazy_ptr_ctype,
+		string_ctype,
+		ptr_ctype, ptr_ctype_noderef, lazy_ptr_ctype,
 		incomplete_ctype, label_ctype, bad_ctype,
 		null_ctype;
 
@@ -740,6 +741,7 @@  static const struct ctype_declare {
 
 	{ &string_ctype,    SYM_PTR,	  0,			    &bits_in_pointer,        &pointer_alignment, &char_ctype },
 	{ &ptr_ctype,	    SYM_PTR,	  0,			    &bits_in_pointer,        &pointer_alignment, &void_ctype },
+	{ &ptr_ctype_noderef,  SYM_PTR,	  MOD_NODEREF,		    &bits_in_pointer,        &pointer_alignment, &void_ctype },
 	{ &null_ctype,	    SYM_PTR,	  0,			    &bits_in_pointer,        &pointer_alignment, &void_ctype },
 	{ &label_ctype,	    SYM_PTR,	  0,			    &bits_in_pointer,        &pointer_alignment, &void_ctype },
 	{ &lazy_ptr_ctype,  SYM_PTR,	  0,			    &bits_in_pointer,        &pointer_alignment, &void_ctype },
diff --git a/symbol.h b/symbol.h
index 3274496..1f338f5 100644
--- a/symbol.h
+++ b/symbol.h
@@ -266,7 +266,7 @@  extern struct symbol	bool_ctype, void_ctype, type_ctype,
 			llong_ctype, sllong_ctype, ullong_ctype,
 			lllong_ctype, slllong_ctype, ulllong_ctype,
 			float_ctype, double_ctype, ldouble_ctype,
-			string_ctype, ptr_ctype, lazy_ptr_ctype,
+			string_ctype, ptr_ctype, ptr_ctype_noderef, lazy_ptr_ctype,
 			incomplete_ctype, label_ctype, bad_ctype,
 			null_ctype;