oils-for-unix / oils

Oils is our upgrade path from bash to a better language and runtime. It's also for Python and JavaScript users who avoid shell!
http://www.oilshell.org/
Other
2.85k stars 159 forks source link

Crash with setvar on out-of-bounds list index #2104

Open jtb20 opened 1 month ago

jtb20 commented 1 month ago

With a version of ysh grabbed from the CI:

julbrown@r15:~$ ysh --version
Oils 0.23.0             https://www.oilshell.org/

git commit = a732611bb0a6daedfff80a694c4830bdf531ae71                                   

I see this:

ysh julbrown@r15:~$ var Q=[]
ysh julbrown@r15:~$ setvar Q[2] = 3
Segmentation fault (core dumped)

FYI! (I expected either an error or automatic list extension -- not sure what should be inserted for the empty values for the latter though.)

andychu commented 4 weeks ago

Fixed this, thank you for the report!

Latest commit should be very good - https://op.oilshell.org/uuu/github-jobs/8115/

jtb20 commented 4 weeks ago

Thank you!