Browse Source

* changed the default WebAssembly exceptions mode from 'no exceptions' to
'branchful exceptions'. Rationale: modern Free Pascal code relies on working
exceptions support, so it's better to offer a slower, but more compatible
option by default.

Nikolay Nikolov 1 day ago
parent
commit
d78ca793b7
1 changed files with 3 additions and 3 deletions
  1. 3 3
      compiler/options.pas

+ 3 - 3
compiler/options.pas

@@ -5740,11 +5740,11 @@ begin
   end;
   end;
 {$endif m68k}
 {$endif m68k}
 {$ifdef wasm}
 {$ifdef wasm}
-  { if no explicit exception handling mode is set for WebAssembly, assume no exceptions }
+  { if no explicit exception handling mode is set for WebAssembly, select branchful exceptions }
   if init_settings.targetswitches*[ts_wasm_no_exceptions,ts_wasm_native_exnref_exceptions,ts_wasm_native_legacy_exceptions,ts_wasm_bf_exceptions]=[] then
   if init_settings.targetswitches*[ts_wasm_no_exceptions,ts_wasm_native_exnref_exceptions,ts_wasm_native_legacy_exceptions,ts_wasm_bf_exceptions]=[] then
     begin
     begin
-      def_system_macro(TargetSwitchStr[ts_wasm_no_exceptions].define);
-      include(init_settings.targetswitches,ts_wasm_no_exceptions);
+      def_system_macro(TargetSwitchStr[ts_wasm_bf_exceptions].define);
+      include(init_settings.targetswitches,ts_wasm_bf_exceptions);
     end;
     end;
 {$endif wasm}
 {$endif wasm}