[PATCH 5/5] evaluate: stifle check if one pointer is a noderef

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If both t1 and t2 are ptr_ctype_noderef then it should be ok to ignore
the address-space of both (in the case of passing to printf style
functions).

Signed-off-by: Ben Dooks <ben.dooks@xxxxxxxxxxxxxxx>
---
 evaluate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/evaluate.c b/evaluate.c
index 2a98a9b..0d5b8ad 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -718,7 +718,8 @@ const char *type_difference(struct ctype *c1, struct ctype *c2,
 			/* XXX: we ought to compare sizes */
 			break;
 		case SYM_PTR:
-			if (as1 != as2)
+			if (as1 != as2 && (t1 != &ptr_ctype_noderef &&
+					   t2 != &ptr_ctype_noderef))
 				return "different address spaces";
 			/* MOD_SPECIFIER is due to idiocy in parse.c */
 			if ((mod1 ^ mod2) & ~MOD_IGNORE & ~MOD_SPECIFIER)
-- 
2.19.1




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux