summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-03-12 11:40:14 +0100
committerAraq <rumpf_a@web.de>2015-03-12 11:40:14 +0100
commit0a0126d49aecc7915ae115f267f99d9510c70bdb (patch)
tree037007d87b783f7e7174a874c810fc9ecac91058 /compiler
parent3aad16e337a18861d76df24f8137d2dbe1144ac2 (diff)
downloadNim-0a0126d49aecc7915ae115f267f99d9510c70bdb.tar.gz
fixes #794 properly
Diffstat (limited to 'compiler')
-rw-r--r--compiler/transf.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/transf.nim b/compiler/transf.nim
index 7e56f09dc..325ce9d5e 100644
--- a/compiler/transf.nim
+++ b/compiler/transf.nim
@@ -399,7 +399,7 @@ proc transformConv(c: PTransf, n: PNode): PTransNode =
       if diff < 0:
         result = newTransNode(nkObjUpConv, n, 1)
         result[0] = transform(c, n.sons[1])
-      elif diff > 0:
+      elif diff > 0 and diff != high(int):
         result = newTransNode(nkObjDownConv, n, 1)
         result[0] = transform(c, n.sons[1])
       else:
@@ -411,7 +411,7 @@ proc transformConv(c: PTransf, n: PNode): PTransNode =
     if diff < 0:
       result = newTransNode(nkObjUpConv, n, 1)
       result[0] = transform(c, n.sons[1])
-    elif diff > 0:
+    elif diff > 0 and diff != high(int):
       result = newTransNode(nkObjDownConv, n, 1)
       result[0] = transform(c, n.sons[1])
     else: