summary refs log tree commit diff stats
path: root/compiler/jsgen.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-08-02 17:00:34 +0800
committerGitHub <noreply@github.com>2023-08-02 11:00:34 +0200
commit825a0e7df40100d92e87fc421a135a84b94f818f (patch)
tree82865cc50f3f1c0793ae70150d02cf37483f3b0f /compiler/jsgen.nim
parentf3a7622514f24740c6b33f0c37ebe6339ad5b70d (diff)
downloadNim-825a0e7df40100d92e87fc421a135a84b94f818f.tar.gz
fixes #22362; Compiler crashes with staticBoundsCheck on (#22363)
Diffstat (limited to 'compiler/jsgen.nim')
-rw-r--r--compiler/jsgen.nim4
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)