diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-05-21 17:31:23 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-05-21 17:31:23 +0200 |
commit | cb6a4ffa865850b254680e47bf04817727e20558 (patch) | |
tree | e38fcc940794725757a69bcafe14eede2db724f7 /compiler | |
parent | feef109e60fd33ff350cbcf82298a7cae83bbd72 (diff) | |
parent | dc809bd485ae9a104666a4ee4a3728eab9e2b39f (diff) | |
download | Nim-cb6a4ffa865850b254680e47bf04817727e20558.tar.gz |
Merge branch 'devel' into araq-big-refactoring
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/cgen.nim | 8 | ||||
-rw-r--r-- | compiler/renderer.nim | 2 | ||||
-rw-r--r-- | compiler/vm.nim | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 89d8ed936..1c5544d4d 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -1116,8 +1116,8 @@ proc registerModuleToMain(g: BModuleList; m: PSym) = var init = m.getInitName datInit = m.getDatInitName - addf(g.mainModProcs, "NIM_EXTERNC N_NOINLINE(void, $1)(void);$N", [init]) - addf(g.mainModProcs, "NIM_EXTERNC N_NOINLINE(void, $1)(void);$N", [datInit]) + addf(g.mainModProcs, "N_LIB_PRIVATE N_NIMCALL(void, $1)(void);$N", [init]) + addf(g.mainModProcs, "N_LIB_PRIVATE N_NIMCALL(void, $1)(void);$N", [datInit]) if sfSystemModule notin m.flags: addf(g.mainDatInit, "\t$1();$N", [datInit]) let initCall = "\t$1();$N" % [init] @@ -1128,7 +1128,7 @@ proc registerModuleToMain(g: BModuleList; m: PSym) = proc genInitCode(m: BModule) = var initname = getInitName(m.module) - var prc = "NIM_EXTERNC N_NOINLINE(void, $1)(void) {$N" % [initname] + var prc = "N_LIB_PRIVATE N_NIMCALL(void, $1)(void) {$N" % [initname] if m.typeNodes > 0: appcg(m, m.s[cfsTypeInit1], "static #TNimNode $1[$2];$n", [m.typeNodesName, rope(m.typeNodes)]) @@ -1170,7 +1170,7 @@ proc genInitCode(m: BModule) = add(prc, deinitGCFrame(m.initProc)) addf(prc, "}$N$N", []) - prc.addf("NIM_EXTERNC N_NOINLINE(void, $1)(void) {$N", + prc.addf("N_LIB_PRIVATE N_NIMCALL(void, $1)(void) {$N", [getDatInitName(m.module)]) for i in cfsTypeInit1..cfsDynLibInit: diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 966bed769..75c19a163 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -189,7 +189,7 @@ proc putComment(g: var TSrcGen, s: string) = put(g, tkComment, com) com = "## " inc(i) - if s[i] == '\x0A': inc(i) + if i < s.len and s[i] == '\x0A': inc(i) optNL(g, ind) of '\x0A': put(g, tkComment, com) diff --git a/compiler/vm.nim b/compiler/vm.nim index afc203059..ecee319d0 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -441,7 +441,7 @@ proc setLenSeq(c: PCtx; node: PNode; newLen: int; info: TLineInfo) = node.sons[i] = newNodeI(typeKind, info) const - errIndexOutOfBounds = "index ouf of bounds" + errIndexOutOfBounds = "index out of bounds" errNilAccess = "attempt to access a nil address" errOverOrUnderflow = "over- or underflow" errConstantDivisionByZero = "division by zero" |