projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
841a78e
)
fix null pointer constants
author
Matthias Braun
<matze@braunis.de>
Wed, 19 Dec 2012 16:55:19 +0000
(17:55 +0100)
committer
Matthias Braun
<matze@braunis.de>
Wed, 19 Dec 2012 16:55:19 +0000
(17:55 +0100)
only a cast to void* gives a null pointer constant, casting to types
compatible with void* not necessarily.
parser.c
patch
|
blob
|
history
diff --git
a/parser.c
b/parser.c
index
95a204f
..
74374c5
100644
(file)
--- a/
parser.c
+++ b/
parser.c
@@
-856,7
+856,7
@@
static bool is_null_pointer_constant(const expression_t *expression)
/* skip void* cast */
if (expression->kind == EXPR_UNARY_CAST) {
type_t *const type = skip_typeref(expression->base.type);
- if (type
s_compatible(type, type_void_ptr)
)
+ if (type
== type_void_ptr
)
expression = expression->unary.value;
}