mvdan / sh

A shell parser, formatter, and interpreter with bash support; includes shfmt
https://pkg.go.dev/mvdan.cc/sh/v3
BSD 3-Clause "New" or "Revised" License
6.99k stars 333 forks source link

expand: avoid panics on division by zero #934

Closed mvdan closed 1 year ago

mvdan commented 1 year ago

(see commit message)

Fixes #892.

mvdan commented 1 year ago

cc @dankegel

mvdan commented 1 year ago

Thanks for the great review, @theclapp. I'll probably bother you for more interpreter reviews, if that's okay :)

mvdan commented 1 year ago

Got a weird failure on Mac I haven't seen before. Maybe the machine crashed somehow.

mvdan commented 1 year ago

I'm perplexed at the repeated macos failure. It happens on pull_request but not on push, which should be the same code. And master passed. And the failure is in the shfmt tests, where it depends on neither of the packages modified here. I'll rerun all the jobs and see...

mvdan commented 1 year ago

Green, so I will ignore that. For the record, they were signal: killed errors in the cmd/shfmt test scripts.