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)])
|
||||
else:
|
||||
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")
|
||||
putIntoDest(p, d, dest, ropecg(p.module, "(($1)#$5($2, $3, $4))", [
|
||||
getTypeDesc(p.module, dest), rdCharLoc(a),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue