fixes #2489
This commit is contained in:
parent
4b382940f0
commit
2176ea759f
2 changed files with 10 additions and 1 deletions
|
|
@ -1587,7 +1587,7 @@ proc genRangeChck(p: BProc, n: PNode, d: var TLoc, magic: string) =
|
||||||
[getTypeDesc(p.module, dest), rdCharLoc(a)])
|
[getTypeDesc(p.module, dest), rdCharLoc(a)])
|
||||||
else:
|
else:
|
||||||
initLocExpr(p, n.sons[0], a)
|
initLocExpr(p, n.sons[0], a)
|
||||||
if leValue(n.sons[2], n.sons[1]):
|
if not leValue(n.sons[1], n.sons[2]):
|
||||||
internalError(n.info, "range check will always fail; empty range")
|
internalError(n.info, "range check will always fail; empty range")
|
||||||
putIntoDest(p, d, dest, ropecg(p.module, "(($1)#$5($2, $3, $4))", [
|
putIntoDest(p, d, dest, ropecg(p.module, "(($1)#$5($2, $3, $4))", [
|
||||||
getTypeDesc(p.module, dest), rdCharLoc(a),
|
getTypeDesc(p.module, dest), rdCharLoc(a),
|
||||||
|
|
|
||||||
9
tests/ccgbugs/tarray_equality.nim
Normal file
9
tests/ccgbugs/tarray_equality.nim
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
discard """
|
||||||
|
output: '''true'''
|
||||||
|
"""
|
||||||
|
|
||||||
|
# bug #2489
|
||||||
|
|
||||||
|
let a = [1]
|
||||||
|
let b = [1]
|
||||||
|
echo a == b
|
||||||
Loading…
Add table
Add a link
Reference in a new issue