mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
@@ -754,8 +754,6 @@ proc isCppRef(p: BProc; typ: PType): bool {.inline.} =
|
||||
tfVarIsPtr notin skipTypes(typ, abstractInstOwned).flags
|
||||
|
||||
proc genDeref(p: BProc, e: PNode, d: var TLoc) =
|
||||
assert e[0].kind notin {nkBlockExpr, nkBlockStmt}, "it should have been transformed in transf"
|
||||
|
||||
let mt = mapType(p.config, e[0].typ, mapTypeChooser(e[0]) == skParam)
|
||||
if mt in {ctArray, ctPtrToArray} and lfEnforceDeref notin d.flags:
|
||||
# XXX the amount of hacks for C's arrays is incredible, maybe we should
|
||||
|
||||
@@ -1019,7 +1019,9 @@ proc transform(c: PTransf, n: PNode): PNode =
|
||||
result = transformAddrDeref(c, n, {nkHiddenDeref})
|
||||
of nkAddr:
|
||||
result = transformAddrDeref(c, n, {nkDerefExpr, nkHiddenDeref})
|
||||
of nkDerefExpr, nkHiddenDeref:
|
||||
of nkDerefExpr:
|
||||
result = transformAddrDeref(c, n, {nkAddr, nkHiddenAddr})
|
||||
of nkHiddenDeref:
|
||||
if n[0].kind in {nkBlockExpr, nkBlockStmt}:
|
||||
# bug #20107 bug #21540. Watch out to not deref the pointer too late.
|
||||
let e = transformDerefBlock(c, n)
|
||||
|
||||
Reference in New Issue
Block a user