diff options
author | Yuriy Glukhov <yuriy.glukhov@gmail.com> | 2015-08-21 13:29:25 +0300 |
---|---|---|
committer | Yuriy Glukhov <yuriy.glukhov@gmail.com> | 2015-08-21 13:29:25 +0300 |
commit | a5be556a4cd58371f21cab6bffc8b333a9aa5c51 (patch) | |
tree | 814f4bad8759d5209b3bdd8c106dd4a93d09968b /compiler | |
parent | 0cc662d8b854335bc31d7739ed41dd222c0cfca8 (diff) | |
download | Nim-a5be556a4cd58371f21cab6bffc8b333a9aa5c51.tar.gz |
Untyped pointers godegen changed. addr expression fixed.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/jsgen.nim | 2 | ||||
-rw-r--r-- | compiler/semmagic.nim | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 89a1b84a2..774f6501a 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -136,7 +136,7 @@ proc mapType(typ: PType): TJSTypeKind = result = etyBaseIndex of tyPointer: # treat a tyPointer like a typed pointer to an array of bytes - result = etyInt + result = etyBaseIndex of tyRange, tyDistinct, tyOrdinal, tyConst, tyMutable, tyIter, tyProxy: result = mapType(t.sons[0]) of tyInt..tyInt64, tyUInt..tyUInt64, tyEnum, tyChar: result = etyInt diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index 0afbf1f07..5d16470b0 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -13,6 +13,8 @@ proc semAddr(c: PContext; n: PNode; isUnsafeAddr=false): PNode = result = newNodeI(nkAddr, n.info) let x = semExprWithType(c, n) + if x.kind == nkSym: + x.sym.flags.incl(sfAddrTaken) if isAssignable(c, x, isUnsafeAddr) notin {arLValue, arLocalLValue}: localError(n.info, errExprHasNoAddress) result.add x |