flow: expressions: don't try updating to uninitialized position
commitb5ed545c9499874378324e65f531dc470a487c35
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 3 Apr 2013 08:39:38 +0000 (3 11:39 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 3 Apr 2013 08:39:38 +0000 (3 11:39 +0300)
tree6d387f57aa04a2d15b888c31d83de115596a929a
parent3a5e426f7e16a1569a0f58750a12def83ba2a3e9
flow: expressions: don't try updating to uninitialized position

smatch_expression.c is designed to take a number and create a struct
expression of EXPR_VALUE for that number.  The problem is what position
should we use?

I guess we should try to use the position closest to what we're working on
right now.  I use the big_expression_stack and the big_statement_stack for
this.

The problem is that sometimes we still don't know.  If set_position() gets
a position with pos.stream == 0 and pos.line == 0 then it does bogus stuff.
Just ignore those values.

This is an ugly hack piece of crap code, obviously.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_expressions.c
smatch_flow.c