Skip to content

Commit

Permalink
fixes a critical xlen codegen bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq committed Nov 3, 2015
1 parent 618d0bc commit 1dda0e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/ccgexprs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1713,7 +1713,7 @@ proc genMagicExpr(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
genArrayLen(p, e, d, op)
of mXLenStr, mXLenSeq:
if not p.module.compileToCpp:
unaryExpr(p, e, d, "($1->Sup.len-1)")
unaryExpr(p, e, d, "($1->Sup.len)")
else:
unaryExpr(p, e, d, "$1->len")
of mGCref: unaryStmt(p, e, d, "#nimGCref($1);$n")
Expand Down

0 comments on commit 1dda0e4

Please sign in to comment.