cap max stack size at 32 bit limit (#17019)

Authored by gershomb on Aug 22 2019, 11:49 AM.