Skip to content

Commit 1e8199a

Browse files
committed
Add a hack for llvm.wasm.throw
As this is the only unwinding intrinsic we use and codegen_llvm_intrinsic_call currently doesn't handle unwinding intrinsics, this uses the conventional call path for llvm.wasm.throw.
1 parent 84c0e1c commit 1e8199a

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_codegen_ssa/src/mir

1 file changed

+4
-0
lines changed

compiler/rustc_codegen_ssa/src/mir/block.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
10391039
if let Some(instance) = instance
10401040
&& let Some(name) = bx.tcx().codegen_fn_attrs(instance.def_id()).symbol_name
10411041
&& name.as_str().starts_with("llvm.")
1042+
// This is the only LLVM intrinsic we use that unwinds
1043+
// FIXME either add unwind support to codegen_llvm_intrinsic_call or replace usage of
1044+
// this intrinsic with something else
1045+
&& name.as_str() != "llvm.wasm.throw"
10421046
{
10431047
assert!(!instance.args.has_infer());
10441048
assert!(!instance.args.has_escaping_bound_vars());

0 commit comments

Comments
 (0)