summaryrefslogtreecommitdiff
path: root/lib/std/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2019-07-14 01:37:36 +0000
committerOri Bernstein <ori@eigenstate.org>2019-07-14 01:37:36 +0000
commit77246bfe1b9f147b1b255e811fb8b2032c49dc9e (patch)
tree52137f1982d5593dd7ef4c028b3cac57a38b1d03 /lib/std/test
parent34d97453258079f514c3297f88663fc23ff6e080 (diff)
downloadmc-77246bfe1b9f147b1b255e811fb8b2032c49dc9e.tar.gz
Fix crash with large shifts in bigint.
Diffstat (limited to 'lib/std/test')
-rw-r--r--lib/std/test/bigint.myr8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/std/test/bigint.myr b/lib/std/test/bigint.myr
index c87f1f3..77b822f 100644
--- a/lib/std/test/bigint.myr
+++ b/lib/std/test/bigint.myr
@@ -21,6 +21,7 @@ const main = {
[.name = "format-zero", .fn = fmtzero],
[.name = "division", .fn = smokediv],
[.name = "modulo", .fn = smokemod],
+ [.name = "shift", .fn = shiftoff],
[.name = "add-negatives", .fn = addneg],
[.name = "sub-negatives", .fn = subneg],
][:])
@@ -264,6 +265,13 @@ const subneg = {c
"0")
}
+const shiftoff = {c
+ run(c, std.mk(`Shr ( \
+ std.mk(`Val "1"), \
+ std.mk(`Val "65"))), \
+ "0")
+}
+
const run = {c : testr.ctx#, e : cmd#, res : byte[:]
var buf : byte[4096]
var v, n