diff options
Diffstat (limited to 'compiler/rodwrite.nim')
-rw-r--r-- | compiler/rodwrite.nim | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/compiler/rodwrite.nim b/compiler/rodwrite.nim index 557b1dabf..addbdade6 100644 --- a/compiler/rodwrite.nim +++ b/compiler/rodwrite.nim @@ -74,7 +74,7 @@ proc newRodWriter(hash: SecureHash, module: PSym): PRodWriter = result.converters = "" result.methods = "" result.init = "" - result.origFile = module.info.toFilename + result.origFile = module.info.toFullPath result.data = newStringOfCap(12_000) proc addModDep(w: PRodWriter, dep: string; info: TLineInfo) = @@ -100,6 +100,10 @@ proc pushType(w: PRodWriter, t: PType) = proc pushSym(w: PRodWriter, s: PSym) = # check so that the stack does not grow too large: if iiTableGet(w.index.tab, s.id) == InvalidKey: + when false: + if s.kind == skMethod: + echo "encoding ", s.id, " ", s.name.s + writeStackTrace() w.sstack.add(s) proc encodeNode(w: PRodWriter, fInfo: TLineInfo, n: PNode, @@ -119,7 +123,7 @@ proc encodeNode(w: PRodWriter, fInfo: TLineInfo, n: PNode, result.add(',') encodeVInt(n.info.line, result) result.add(',') - encodeVInt(fileIdx(w, toFilename(n.info)), result) + encodeVInt(fileIdx(w, toFullPath(n.info)), result) elif fInfo.line != n.info.line: result.add('?') encodeVInt(n.info.col, result) @@ -224,8 +228,7 @@ proc encodeType(w: PRodWriter, t: PType, result: var string) = if t.lockLevel.ord != UnspecifiedLockLevel.ord: add(result, '\14') encodeVInt(t.lockLevel.int16, result) - - if t.destructor != nil: + if t.destructor != nil and t.destructor.id != 0: add(result, '\15') encodeVInt(t.destructor.id, result) pushSym(w, t.destructor) @@ -293,7 +296,7 @@ proc encodeSym(w: PRodWriter, s: PSym, result: var string) = result.add(',') if s.info.line != -1'i16: encodeVInt(s.info.line, result) result.add(',') - encodeVInt(fileIdx(w, toFilename(s.info)), result) + encodeVInt(fileIdx(w, toFullPath(s.info)), result) if s.owner != nil: result.add('*') encodeVInt(s.owner.id, result) @@ -607,7 +610,7 @@ proc process(c: PPassContext, n: PNode): PNode = for i in countup(0, sonsLen(n) - 1): addModDep(w, getModuleName(n.sons[i]), n.info) addStmt(w, n) - of nkFromStmt: + of nkFromStmt, nkImportExceptStmt: addModDep(w, getModuleName(n.sons[0]), n.info) addStmt(w, n) of nkIncludeStmt: |