diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2023-08-02 17:00:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-02 11:00:34 +0200 |
commit | 825a0e7df40100d92e87fc421a135a84b94f818f (patch) | |
tree | 82865cc50f3f1c0793ae70150d02cf37483f3b0f /compiler/jsgen.nim | |
parent | f3a7622514f24740c6b33f0c37ebe6339ad5b70d (diff) | |
download | Nim-825a0e7df40100d92e87fc421a135a84b94f818f.tar.gz |
fixes #22362; Compiler crashes with staticBoundsCheck on (#22363)
Diffstat (limited to 'compiler/jsgen.nim')
-rw-r--r-- | compiler/jsgen.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 8be4d9d07..a5f4d29b2 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -50,6 +50,7 @@ type graph: ModuleGraph config: ConfigRef sigConflicts: CountTable[SigHash] + initProc: PProc BModule = ref TJSGen TJSTypeKind = enum # necessary JS "types" @@ -158,6 +159,8 @@ proc newProc(globals: PGlobals, module: BModule, procDef: PNode, options: TOptions): PProc = result = PProc( blocks: @[], + optionsStack: if module.initProc != nil: module.initProc.optionsStack + else: @[], options: options, module: module, procDef: procDef, @@ -3036,6 +3039,7 @@ proc processJSCodeGen*(b: PPassContext, n: PNode): PNode = if m.module == nil: internalError(m.config, n.info, "myProcess") let globals = PGlobals(m.graph.backend) var p = newInitProc(globals, m) + m.initProc = p p.unique = globals.unique genModule(p, n) p.g.code.add(p.locals) |