mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 06:45:27 +00:00
make --exceptions:quirky work with C++ (#21581)
* make --exceptions:quirky work with C++ * make tests green again
This commit is contained in:
@@ -448,7 +448,7 @@ proc raiseExceptionAux(e: sink(ref Exception)) {.nodestroy.} =
|
||||
else:
|
||||
pushCurrentException(e)
|
||||
{.emit: "throw `e`;".}
|
||||
elif defined(nimQuirky) or gotoBasedExceptions:
|
||||
elif quirkyExceptions or gotoBasedExceptions:
|
||||
pushCurrentException(e)
|
||||
when gotoBasedExceptions:
|
||||
inc nimInErrorMode
|
||||
@@ -560,7 +560,7 @@ proc nimFrame(s: PFrame) {.compilerRtl, inl, raises: [].} =
|
||||
when defined(cpp) and appType != "lib" and not gotoBasedExceptions and
|
||||
not defined(js) and not defined(nimscript) and
|
||||
hostOS != "standalone" and hostOS != "any" and not defined(noCppExceptions) and
|
||||
not defined(nimQuirky):
|
||||
not quirkyExceptions:
|
||||
|
||||
type
|
||||
StdException {.importcpp: "std::exception", header: "<exception>".} = object
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
|
||||
{.push profiler: off.}
|
||||
|
||||
const gotoBasedExceptions = compileOption("exceptions", "goto")
|
||||
const
|
||||
gotoBasedExceptions = compileOption("exceptions", "goto")
|
||||
quirkyExceptions = compileOption("exceptions", "quirky")
|
||||
|
||||
when hostOS == "standalone":
|
||||
include "$projectpath/panicoverride"
|
||||
@@ -21,7 +23,7 @@ when hostOS == "standalone":
|
||||
rawoutput(message)
|
||||
panic(arg)
|
||||
|
||||
elif (defined(nimQuirky) or defined(nimPanics)) and not defined(nimscript):
|
||||
elif (quirkyExceptions or defined(nimPanics)) and not defined(nimscript):
|
||||
import ansi_c
|
||||
|
||||
func name(t: typedesc): string {.magic: "TypeTrait".}
|
||||
|
||||
@@ -3,7 +3,7 @@ discard """
|
||||
exitcode: "1"
|
||||
output: '''
|
||||
t14444.nim(13) t14444
|
||||
fatal.nim(51) sysFatal
|
||||
fatal.nim(53) sysFatal
|
||||
Error: unhandled exception: index out of bounds, the container is empty [IndexDefect]
|
||||
'''
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user