diff options
author | Araq <rumpf_a@web.de> | 2017-10-15 00:52:22 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2017-10-15 00:52:22 +0200 |
commit | 3aaf1e498058418f09b1a2b25ca08e873de37783 (patch) | |
tree | 1806ebd9ebae66165c89413c79ba9cce514275f2 /compiler | |
parent | a75f3b36619cf06aee324b80b908fbcdc58b43d8 (diff) | |
download | Nim-3aaf1e498058418f09b1a2b25ca08e873de37783.tar.gz |
make httpclient compile again via a workaround
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/sempass2.nim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index e9a1160e5..bd156dc72 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -582,7 +582,10 @@ proc trackOperand(tracked: PEffects, n: PNode, paramType: PType) = if n.kind == nkSym and isLocalVar(tracked, n.sym): makeVolatile(tracked, n.sym) if paramType != nil and paramType.kind == tyProc and tfGcSafe in paramType.flags: - if tfGcSafe notin a.typ.flags and not tracked.inEnforcedGcSafe: + let argtype = skipTypes(a.typ, abstractInst) + # XXX figure out why this can be a non tyProc here. See httpclient.nim for an + # example that triggers it. + if argtype.kind == tyProc and notGcSafe(argtype) and not tracked.inEnforcedGcSafe: localError(n.info, $n & " is not GC safe") notNilCheck(tracked, n, paramType) @@ -736,7 +739,7 @@ proc track(tracked: PEffects, n: PNode) = if not (a.kind == nkSym and a.sym == tracked.owner): markSideEffect(tracked, a) if a.kind != nkSym or a.sym.magic != mNBindSym: - for i in 1 .. <len(n): trackOperand(tracked, n.sons[i], paramType(op, i)) + for i in 1 ..< len(n): trackOperand(tracked, n.sons[i], paramType(op, i)) if a.kind == nkSym and a.sym.magic in {mNew, mNewFinalize, mNewSeq}: # may not look like an assignment, but it is: let arg = n.sons[1] |