File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -1890,13 +1890,13 @@ proc genInitCode(m: BModule) =
1890
1890
if beforeRetNeeded in m.initProc.flags:
1891
1891
prc.add (" \t BeforeRet_: ;\n " )
1892
1892
1893
- if sfMainModule in m.module.flags and m.config.exc == excGoto:
1893
+ if m.config.exc == excGoto:
1894
1894
if getCompilerProc (m.g.graph, " nimTestErrorFlag" ) != nil :
1895
1895
m.appcg (prc, " \t #nimTestErrorFlag();$n" , [])
1896
1896
1897
1897
if optStackTrace in m.initProc.options and preventStackTrace notin m.flags:
1898
1898
prc.add (deinitFrame (m.initProc))
1899
- elif sfMainModule in m.module.flags and m.config.exc == excGoto:
1899
+ elif m.config.exc == excGoto:
1900
1900
if getCompilerProc (m.g.graph, " nimTestErrorFlag" ) != nil :
1901
1901
m.appcg (prc, " \t #nimTestErrorFlag();$n" , [])
1902
1902
Original file line number Diff line number Diff line change
1
+ # ModuleB
2
+ echo " First top-level statement of ModuleB"
3
+ echo high (int ) + 1
4
+ echo " ModuleB last statement"
Original file line number Diff line number Diff line change
1
+ discard """
2
+ exitcode: 1
3
+ output: '''
4
+ First top-level statement of ModuleB
5
+ m22469.nim(3) m22469
6
+ fatal.nim(53) sysFatal
7
+ Error: unhandled exception: over- or underflow [OverflowDefect]
8
+ '''
9
+ """
10
+
11
+ # bug #22469
12
+
13
+ # ModuleA
14
+ import m22469
15
+ echo " ModuleA about to have exception"
16
+ echo high (int ) + 1
You can’t perform that action at this time.
0 commit comments