titan-lang / titan

The Titan programming language
http://titan-lang.org
MIT License
406 stars 13 forks source link

Make Titan bitshift operators behave the same as Lua #214

Closed hugomg closed 6 years ago

hugomg commented 6 years ago

In Lua, shifting by negative numbers shifts in the opposite direction and shifting by an amount greater than or equal to the width of the integer type results in 0.

Previously we were compiling titan bitshifts directly into C bitshifts, which would run into undefined behavior in those cases.

codecov-io commented 6 years ago

Codecov Report

Merging #214 into lablua will increase coverage by 0.04%. The diff coverage is 100%.

Impacted Files Coverage Δ
titan-compiler/coder.lua 90.03% <100%> (+0.12%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d60e9ca...c522e28. Read the comment docs.