summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/ccgexprs.nim2
-rw-r--r--tests/ccgbugs/tarray_equality.nim8
2 files changed, 7 insertions, 3 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 4123be7b9..11c9d2d50 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -1587,8 +1587,6 @@ proc genRangeChck(p: BProc, n: PNode, d: var TLoc, magic: string) =
         [getTypeDesc(p.module, dest), rdCharLoc(a)])
   else:
     initLocExpr(p, n.sons[0], a)
-    if not leValue(n.sons[1], n.sons[2]):
-      internalError(n.info, "range check will always fail; empty range")
     putIntoDest(p, d, dest, ropecg(p.module, "(($1)#$5($2, $3, $4))", [
         getTypeDesc(p.module, dest), rdCharLoc(a),
         genLiteral(p, n.sons[1], dest), genLiteral(p, n.sons[2], dest),
diff --git a/tests/ccgbugs/tarray_equality.nim b/tests/ccgbugs/tarray_equality.nim
index 1d4465477..66a953439 100644
--- a/tests/ccgbugs/tarray_equality.nim
+++ b/tests/ccgbugs/tarray_equality.nim
@@ -1,5 +1,6 @@
 discard """
-  output: '''true'''
+  output: '''true
+true'''
 """
 
 # bug #2489
@@ -7,3 +8,8 @@ discard """
 let a = [1]
 let b = [1]
 echo a == b
+
+# bug #2498
+var x: array[0, int]
+var y: array[0, int]
+echo x == y