struct_assignment: use the ->zeroed flag from allocations
commitbf7aa2ef2440ecf7a5aa95d7ebd5277b7216b1a1
authorDan Carpenter <dan.carpenter@linaro.org>
Thu, 11 Apr 2024 09:48:36 +0000 (11 12:48 +0300)
committerDan Carpenter <dan.carpenter@linaro.org>
Thu, 11 Apr 2024 09:48:36 +0000 (11 12:48 +0300)
tree9e92418fc1ffda2eb724492d84b9ce66767f9d55
parent1f7edd8bf310ee8f9554855461bc3476206cc67f
struct_assignment: use the ->zeroed flag from allocations

The struct assignment tracks when we assign a zeroed buffer to a struct.
Basically the current code said that kcalloc() returns zero and in the
kernel if it has "zalloc" name then it's zero.  This works when it works,
but now we have better data in smatch_allocations.c so we can use that
instead.

I had to add support for early allocation hooks to do this.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
smatch.h
smatch_allocations.c
smatch_function_hooks.c
smatch_struct_assignment.c