string to cstring conversions produce the empty C string for nil; this will be consistent with alternative string implementations
This commit is contained in:
parent
84c4e7a502
commit
aded62520b
3 changed files with 9 additions and 6 deletions
|
|
@ -1740,7 +1740,7 @@ proc genConv(p: BProc, e: PNode, d: var TLoc) =
|
|||
proc convStrToCStr(p: BProc, n: PNode, d: var TLoc) =
|
||||
var a: TLoc
|
||||
initLocExpr(p, n.sons[0], a)
|
||||
putIntoDest(p, d, n, "$1->data" % [rdLoc(a)],
|
||||
putIntoDest(p, d, n, "($1 ? $1->data : \"\")" % [rdLoc(a)],
|
||||
a.storage)
|
||||
|
||||
proc convCStrToStr(p: BProc, n: PNode, d: var TLoc) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue