From 825a0e7df40100d92e87fc421a135a84b94f818f Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Wed, 2 Aug 2023 17:00:34 +0800 Subject: fixes #22362; Compiler crashes with staticBoundsCheck on (#22363) --- compiler/jsgen.nim | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/jsgen.nim') 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) -- cgit 1.4.1-2-gfad0