flow: handle declarations inside for loops
commit54fbf34102a8652a3ac2a3673d4d2d37af9b6a27
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 14 Jun 2023 07:25:23 +0000 (14 10:25 +0300)
committerDan Carpenter <dan.carpenter@linaro.org>
Wed, 14 Jun 2023 07:25:23 +0000 (14 10:25 +0300)
tree247d7b615aa0842af54ae642a2af061595e1b622
parent0684bc20248ec837c5a788413543f6c2c3f7e112
flow: handle declarations inside for loops

Somehow I expected that if you had code like:

for (int i = 0; i < 10; i++) {

That the "int i = 0;" would show up as a declaration statement in the
stmt->iterator_pre_statement but it turns out it's actually stored in the
stmt->iterator_syms.

This didn't matter for the kernel until fairly recently because we never
used to allow these kinds of declarations.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
smatch_flow.c