Fix #4228
Merge pull request #4236 from JuliaLang/kms/cumsum_cumprod

Fix #4228