parent
c7c495f08a
commit
6b88ce3384
3 changed files with 14 additions and 2 deletions
|
|
@ -16,7 +16,12 @@ proc semAddr(c: PContext; n: PNode; isUnsafeAddr=false): PNode =
|
|||
if x.kind == nkSym:
|
||||
x.sym.flags.incl(sfAddrTaken)
|
||||
if isAssignable(c, x, isUnsafeAddr) notin {arLValue, arLocalLValue}:
|
||||
localError(c.config, n.info, errExprHasNoAddress)
|
||||
# Do not suggest the use of unsafeAddr if this expression already is a
|
||||
# unsafeAddr
|
||||
if isUnsafeAddr:
|
||||
localError(c.config, n.info, errExprHasNoAddress)
|
||||
else:
|
||||
localError(c.config, n.info, errExprHasNoAddress & "; maybe use 'unsafeAddr'")
|
||||
result.add x
|
||||
result.typ = makePtrType(c, x.typ)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue