sjbarag / brs

An interpreter for the BrightScript language that runs on non-Roku platforms.
MIT License
114 stars 43 forks source link

fix(interp): don't mutate function call arguments while type-checking #631

Closed sjbarag closed 3 years ago

sjbarag commented 3 years ago

While it's a bit of an edge-case with "in the wild BrightScript", it was previously possible for brs to accidentally mutate the arguments passed to a function while type-checking those arguments. Make a shallow copy of the provided arguments before performing type checking and type coercion.

sjbarag commented 3 years ago

This might break the existing type coercion — I've gotta do more digging to figure that out 😬

sjbarag commented 3 years ago

Combining with #620