Initial support for handling stack-allocated arrays in cap-stack mode.
This is a very ugly hack and is very fragile, but it works for simple examples...