replace VLA with alloca for MSVC
Merge pull request #9096 from tkelman/vla-fix

replace VLA with alloca for MSVC