fixes #5549
This commit is contained in:
parent
e844e536bf
commit
432a4d1787
2 changed files with 26 additions and 15 deletions
|
|
@ -444,6 +444,7 @@ proc assignGlobalVar(p: BProc, n: PNode) =
|
||||||
return
|
return
|
||||||
useHeader(p.module, s)
|
useHeader(p.module, s)
|
||||||
if lfNoDecl in s.loc.flags: return
|
if lfNoDecl in s.loc.flags: return
|
||||||
|
if not containsOrIncl(p.module.declaredThings, s.id):
|
||||||
if sfThread in s.flags:
|
if sfThread in s.flags:
|
||||||
declareThreadVar(p.module, s, sfImportc in s.flags)
|
declareThreadVar(p.module, s, sfImportc in s.flags)
|
||||||
else:
|
else:
|
||||||
|
|
@ -1036,7 +1037,7 @@ proc genVarPrototype(m: BModule, n: PNode) =
|
||||||
let sym = n.sym
|
let sym = n.sym
|
||||||
useHeader(m, sym)
|
useHeader(m, sym)
|
||||||
fillLoc(sym.loc, locGlobalVar, n, mangleName(m, sym), OnHeap)
|
fillLoc(sym.loc, locGlobalVar, n, mangleName(m, sym), OnHeap)
|
||||||
if (lfNoDecl in sym.loc.flags) or containsOrIncl(m.declaredThings, sym.id):
|
if (lfNoDecl in sym.loc.flags) or contains(m.declaredThings, sym.id):
|
||||||
return
|
return
|
||||||
if sym.owner.id != m.module.id:
|
if sym.owner.id != m.module.id:
|
||||||
# else we already have the symbol generated!
|
# else we already have the symbol generated!
|
||||||
|
|
|
||||||
|
|
@ -35,3 +35,13 @@ try:
|
||||||
except:
|
except:
|
||||||
echo "caught"
|
echo "caught"
|
||||||
|
|
||||||
|
|
||||||
|
# issue 5549
|
||||||
|
|
||||||
|
var strs: seq[string] = @[]
|
||||||
|
|
||||||
|
try:
|
||||||
|
discard
|
||||||
|
finally:
|
||||||
|
for foobar in strs:
|
||||||
|
discard
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue