diff options
author | Jaden Weiss <[email protected]> | 2020-03-28 12:35:19 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-28 17:35:19 +0100 |
commit | 5cc130bb6ea92882cce391c4251159dc2effd95f (patch) | |
tree | c88573940ef57c1c013e63f129240bec0dbad64c /testdata/binop.txt | |
parent | 91d1a23b14fd95fb8bdcf306007a2c47d87c32a7 (diff) | |
download | tinygo-5cc130bb6ea92882cce391c4251159dc2effd95f.tar.gz tinygo-5cc130bb6ea92882cce391c4251159dc2effd95f.zip |
compiler: implement spec-compliant shifts
Previously, the compiler used LLVM's shift instructions directly, which have UB whenever the shifts are large or negative.
This commit adds runtime checks for negative shifts, and handles oversized shifts.
Diffstat (limited to 'testdata/binop.txt')
-rw-r--r-- | testdata/binop.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/testdata/binop.txt b/testdata/binop.txt index 8d1f37be8..a8370b19b 100644 --- a/testdata/binop.txt +++ b/testdata/binop.txt @@ -54,3 +54,11 @@ false true true true +shifts +true +true +true +true +true +true +true |