mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-08 14:03:23 +00:00
fixes a critical xlen codegen bug
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user