Re: [PATCH] drm/vc4_validate: Remove VLA usage

2018-03-16 Thread Eric Anholt
"Gustavo A. R. Silva" writes: > In preparation to enabling -Wvla, remove VLA. In this particular > case use macro ARRAY_SIZE so the length of array _bo_ can be > computed at preprocessing time. > > The use of stack Variable Length Arrays needs to be avoided, as they > can

[PATCH] drm/vc4_validate: Remove VLA usage

2018-03-14 Thread Gustavo A. R. Silva
In preparation to enabling -Wvla, remove VLA. In this particular case use macro ARRAY_SIZE so the length of array _bo_ can be computed at preprocessing time. The use of stack Variable Length Arrays needs to be avoided, as they can be a vector for stack exhaustion, which can be both a runtime bug