From 3365b42bbe5e09f8e8a739597ae5e49e2ff2c259 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 27 Mar 2014 19:20:59 +0100 Subject: fixes #1009 --- compiler/vm.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/vm.nim') diff --git a/compiler/vm.nim b/compiler/vm.nim index 268289aca..0d5386502 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -318,7 +318,7 @@ proc opConv*(dest: var TFullReg, src: TFullReg, desttyp, srctyp: PType): bool = of tyFloat..tyFloat64: dest.intVal = system.toInt(src.floatVal) else: - dest.intVal = src.intVal and ((1 shl desttyp.size)-1) + dest.intVal = src.intVal and ((1 shl (desttyp.size*8))-1) of tyFloat..tyFloat64: if dest.kind != rkFloat: myreset(dest); dest.kind = rkFloat -- cgit 1.4.1-2-gfad0