Skip to content

Commit 82e65eb

Browse files
committed
Add debug check
1 parent b8738d3 commit 82e65eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/function.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ impl<'ctx> Function<'ctx> {
135135
pub fn get_param(&self, idx: i32) -> Parameter<'ctx> {
136136
unsafe {
137137
let ptr = gccjit_sys::gcc_jit_function_get_param(self.ptr, idx);
138+
#[cfg(debug_assertions)]
139+
if let Ok(Some(error)) = self.to_object().get_context().get_last_error() {
140+
panic!("{} ({:?})", error, self);
141+
}
138142
parameter::from_ptr(ptr)
139143
}
140144
}

0 commit comments

Comments
 (0)