diff --git a/CHANGELOG.md b/CHANGELOG.md index 15d554e275..def7a5ffab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ #### Big news - Frontend, druntime and Phobos are at version [2.113.0](https://dlang.org/changelog/2.113.0.html), incl. new command-line option `-foptimize-nothrow` to restore the `nothrow` optimizations. (#5113, #5221, #5239) - - `-foptimize-nothrow` is the default setting when targeting Windows, to make hitting https://github.com/ldc-developers/ldc/issues/3504 much less likely. + - `-foptimize-nothrow` is the default setting when targeting Windows or WebAssembly, to make hitting https://github.com/ldc-developers/ldc/issues/3504 much less likely. - Support for [LLVM 22](https://releases.llvm.org/22.1.0/docs/ReleaseNotes.html). The prebuilt packages use v22.1.8. (#5097, #5102, #5172) - Minimum LLVM version raised to 18. (#5094) - New prebuilt **addon packages** (`ldc2-*-addon-.tar.xz`) for simple cross-compilation. Simply unpack them directly into your LDC installation directory, and then cross-compile via `-mtriple=…` (or `dub --target=…`): (#5240) diff --git a/driver/cl_options.cpp b/driver/cl_options.cpp index a75a1a8873..f5ed2987df 100644 --- a/driver/cl_options.cpp +++ b/driver/cl_options.cpp @@ -762,7 +762,7 @@ cl::opt fOptimizeNothrow( cl::location(global.params.nothrowOptimizations), cl::desc("Omit EH cleanups (destructors/`finally`/`scope(exit)`) when " "Errors unwind through nothrow code. Defaults to true for Windows " - "targets, to make hitting " + "and WebAssembly targets, to make hitting " "https://github.com/ldc-developers/ldc/issues/3504 less likely.")); #if LDC_LLVM_SUPPORTED_TARGET_SPIRV || LDC_LLVM_SUPPORTED_TARGET_NVPTX || LDC_LLVM_SUPPORTED_TARGET_AArch64 diff --git a/driver/main.cpp b/driver/main.cpp index 80612cd1bd..89475c50bd 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -1262,8 +1262,8 @@ int cppmain() { global.params.dllimport = DLLImport::none; } - if (triple->isWindowsMSVCEnvironment() && - opts::fOptimizeNothrow.getNumOccurrences() == 0) { + if (opts::fOptimizeNothrow.getNumOccurrences() == 0 && + (triple->isWindowsMSVCEnvironment() || triple->isWasm())) { // FIXME: make https://github.com/ldc-developers/ldc/issues/3504 much less // likely for now global.params.nothrowOptimizations = true;