浏览代码

* use a_throw instead of a_legacy_throw in twasminlinenode.second_throw_fpcexception, unless legacy exceptions mode is selected

Nikolay Nikolov 19 小时之前
父节点
当前提交
4801ddaf0a
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      compiler/wasm32/nwasminl.pas

+ 4 - 1
compiler/wasm32/nwasminl.pas

@@ -440,7 +440,10 @@ implementation
     procedure twasminlinenode.second_throw_fpcexception;
       begin
         location_reset(location,LOC_VOID,OS_NO);
-        current_asmdata.CurrAsmList.Concat(taicpu.op_sym(a_legacy_throw,current_asmdata.WeakRefAsmSymbol(FPC_EXCEPTION_TAG_SYM,AT_WASM_EXCEPTION_TAG)));
+        if ts_wasm_native_legacy_exceptions in current_settings.targetswitches then
+          current_asmdata.CurrAsmList.Concat(taicpu.op_sym(a_legacy_throw,current_asmdata.WeakRefAsmSymbol(FPC_EXCEPTION_TAG_SYM,AT_WASM_EXCEPTION_TAG)))
+        else
+          current_asmdata.CurrAsmList.Concat(taicpu.op_sym(a_throw,current_asmdata.WeakRefAsmSymbol(FPC_EXCEPTION_TAG_SYM,AT_WASM_EXCEPTION_TAG)));
       end;