sjbarag / brs

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

fix(int): Match RBI result when coercing Int64 to Int32 #630

Closed sjbarag closed 3 years ago

sjbarag commented 3 years ago

RBI appears to ignore the upper 32 bits when converting a 64-bit integer ("LongInteger") to a 32-bit integer ("integer"), which brs didn't previously do. Use only the least-significant 32 bits when creating a 32-bit integer from an instance of Long.

sjbarag commented 3 years ago

This came up in #620 as one of the issues found while writing tests, but it seems to warrant a separate PR.