returns the correct type when evaluating NULL
commitfee3d01d7ac170e7e90b8cd7f4923dbf3de8df7c
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Thu, 2 Mar 2017 09:51:33 +0000 (2 10:51 +0100)
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Fri, 19 May 2017 03:28:31 +0000 (19 05:28 +0200)
treefec490477cce3c31e18b1735ecb6f82f177a3523
parente35efe330c6ae7d154197c29b127560d569016d0
returns the correct type when evaluating NULL

In evaluate_cast(), the expression '(void*)<some zero constant>',
aka 'NULL', is detected and given the type 'null_ctype',
a special kind of pointer type.
However the returned type is the original one: 'void *'.

This doesn't seem to be intented as in all other cases, the
evaluate_...() functions and ultimately evaluate_expression()
always return the type of the expression.

Fix this by returning the type given to the expression: null_ctype.

Reported-by: Dibyendu Majumdar <mobile@majumdar.org.uk>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
evaluate.c