summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorYuriy Glukhov <yuriy.glukhov@gmail.com>2015-08-21 13:29:25 +0300
committerYuriy Glukhov <yuriy.glukhov@gmail.com>2015-08-21 13:29:25 +0300
commita5be556a4cd58371f21cab6bffc8b333a9aa5c51 (patch)
tree814f4bad8759d5209b3bdd8c106dd4a93d09968b /compiler
parent0cc662d8b854335bc31d7739ed41dd222c0cfca8 (diff)
downloadNim-a5be556a4cd58371f21cab6bffc8b333a9aa5c51.tar.gz
Untyped pointers godegen changed. addr expression fixed.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/jsgen.nim2
-rw-r--r--compiler/semmagic.nim2
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