diff --git a/compiler/backend/ccgexprs.nim b/compiler/backend/ccgexprs.nim index 34717bd7b71..0410ff813bb 100644 --- a/compiler/backend/ccgexprs.nim +++ b/compiler/backend/ccgexprs.nim @@ -1638,7 +1638,7 @@ proc useData(p: BProc, x: ConstId, typ: PType): string = proc expr(p: BProc, n: CgNode, d: var TLoc) = when defined(nimCompilerStacktraceHints): - frameMsg(p.config, n) + frameMsg(p.config, n.info) p.currLineInfo = n.info case n.kind diff --git a/compiler/backend/cgirgen.nim b/compiler/backend/cgirgen.nim index 5d36237e7a6..1230c8b382a 100644 --- a/compiler/backend/cgirgen.nim +++ b/compiler/backend/cgirgen.nim @@ -47,6 +47,9 @@ import std/options as std_options from compiler/ast/ast import newSym, newType, rawAddSon from compiler/sem/semdata import makeVarType +when defined(nimCompilerStacktraceHints): + import compiler/utils/debugutils + type TranslateCl = object graph: ModuleGraph @@ -557,6 +560,9 @@ proc stmtToIr(tree: MirBody, env: MirEnv, cl: var TranslateCl, let n {.cursor.} = tree.get(cr) let info = cr.info ## the source information of `n` + when defined(nimCompilerStacktraceHints): + frameMsg(cl.graph.config, info) + template to(kind: CgNodeKind, args: varargs[untyped]) = stmts.add newStmt(kind, info, args) @@ -683,6 +689,9 @@ proc exprToIr(tree: MirBody, cl: var TranslateCl, let n {.cursor.} = get(tree, cr) let info = cr.info + when defined(nimCompilerStacktraceHints): + frameMsg(cl.graph.config, info) + template op(kind: CgNodeKind, e: CgNode): CgNode = newOp(kind, info, cl.map(n.typ), e) diff --git a/compiler/sem/sighashes.nim b/compiler/sem/sighashes.nim index e56fc615aed..152deff135f 100644 --- a/compiler/sem/sighashes.nim +++ b/compiler/sem/sighashes.nim @@ -188,6 +188,9 @@ proc hashType(c: var MD5Context, t: PType; flags: set[ConsiderFlag]) = c.hashTree(t.n, {}) of tyTuple: c &= char(t.kind) + # add the length so that (int, int) and ((int,), int) have different + # representations + c &= t.len if t.n != nil and CoType notin flags: assert(t.n.len == t.len) for i in 0..