fixes #2498
This commit is contained in:
parent
06feaef64a
commit
28ecf72f79
2 changed files with 7 additions and 3 deletions
|
|
@ -1587,8 +1587,6 @@ 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 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))", [
|
putIntoDest(p, d, dest, ropecg(p.module, "(($1)#$5($2, $3, $4))", [
|
||||||
getTypeDesc(p.module, dest), rdCharLoc(a),
|
getTypeDesc(p.module, dest), rdCharLoc(a),
|
||||||
genLiteral(p, n.sons[1], dest), genLiteral(p, n.sons[2], dest),
|
genLiteral(p, n.sons[1], dest), genLiteral(p, n.sons[2], dest),
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
discard """
|
discard """
|
||||||
output: '''true'''
|
output: '''true
|
||||||
|
true'''
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# bug #2489
|
# bug #2489
|
||||||
|
|
@ -7,3 +8,8 @@ discard """
|
||||||
let a = [1]
|
let a = [1]
|
||||||
let b = [1]
|
let b = [1]
|
||||||
echo a == b
|
echo a == b
|
||||||
|
|
||||||
|
# bug #2498
|
||||||
|
var x: array[0, int]
|
||||||
|
var y: array[0, int]
|
||||||
|
echo x == y
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue