Skip to content

Commit ddaf931

Browse files
committed
Add support for exceptions configuration
1 parent 6cba270 commit ddaf931

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

tests/test_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def test_smoke(self):
1616
config.wasm_multi_value = True
1717
config.wasm_multi_memory = True
1818
config.wasm_memory64 = True
19+
config.wasm_exceptions = True
1920
config.cranelift_debug_verifier = True
2021
config.strategy = "cranelift"
2122
config.strategy = "auto"

wasmtime/_bindings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,6 +2441,12 @@ def wasmtime_pooling_allocation_strategy_set(arg0: Any, arg1: Any) -> None:
24412441
def wasmtime_config_wasm_component_model_set(arg0: Any, arg1: Any) -> None:
24422442
return _wasmtime_config_wasm_component_model_set(arg0, arg1) # type: ignore
24432443

2444+
_wasmtime_config_wasm_exceptions_set = dll.wasmtime_config_wasm_exceptions_set
2445+
_wasmtime_config_wasm_exceptions_set.restype = None
2446+
_wasmtime_config_wasm_exceptions_set.argtypes = [POINTER(wasm_config_t), c_bool]
2447+
def wasmtime_config_wasm_exceptions_set(arg0: Any, arg1: Any) -> None:
2448+
return _wasmtime_config_wasm_exceptions_set(arg0, arg1) # type: ignore
2449+
24442450
_wasmtime_engine_clone = dll.wasmtime_engine_clone
24452451
_wasmtime_engine_clone.restype = POINTER(wasm_engine_t)
24462452
_wasmtime_engine_clone.argtypes = [POINTER(wasm_engine_t)]

wasmtime/_config.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,18 @@ def wasm_relaxed_simd_deterministic(self, enable: bool) -> None:
160160
raise TypeError('expected a bool')
161161
ffi.wasmtime_config_wasm_relaxed_simd_deterministic_set(self.ptr(), enable)
162162

163+
@setter_property
164+
def wasm_exceptions(self, enable: bool) -> None:
165+
"""
166+
Configures whether the wasm [exceptions proposal] is enabled.
167+
168+
[exceptions proposal]: https://github.com/WebAssembly/exception-handling
169+
"""
170+
171+
if not isinstance(enable, bool):
172+
raise TypeError('expected a bool')
173+
ffi.wasmtime_config_wasm_exceptions_set(self.ptr(), enable)
174+
163175
@setter_property
164176
def strategy(self, strategy: str) -> None:
165177
"""

0 commit comments

Comments
 (0)