diff --git a/lib/llvm-backend/src/code.rs b/lib/llvm-backend/src/code.rs index 4398b3548e8..004d0e3867e 100644 --- a/lib/llvm-backend/src/code.rs +++ b/lib/llvm-backend/src/code.rs @@ -1151,7 +1151,9 @@ impl FunctionCodeGenerator for LLVMFunctionCodeGenerator { builder.build_store(ptr_to_value, value); } GlobalCache::Const { value: _ } => { - unreachable!("cannot set non-mutable globals") + return Err(CodegenError { + message: "global is immutable".to_string(), + }); } } } diff --git a/lib/spectests/tests/excludes.txt b/lib/spectests/tests/excludes.txt index 741aba8c15f..ae3cc7fef57 100644 --- a/lib/spectests/tests/excludes.txt +++ b/lib/spectests/tests/excludes.txt @@ -825,7 +825,6 @@ llvm:skip:skip-stack-guard-page.wast:* # Spec running forever or (signal: 4, SIG llvm:skip:linking.wast:236 # terminating with uncaught exception of type WasmTrap llvm:skip:linking.wast:248 # terminating with uncaught exception of type WasmTrap -llvm:fail:globals.wast:243 # AssertInvalid - caught panic Any llvm:fail:i32.wast:243 # AssertReturn - result I32(61374799) ("0x3a8814f") does not match expected I32(32) ("0x20") llvm:fail:i32.wast:252 # AssertReturn - result I32(61374816) ("0x3a88160") does not match expected I32(32) ("0x20") llvm:fail:i64.wast:243 # AssertReturn - result I64(4356342255) ("0x103a881ef") does not match expected I64(64) ("0x40")