include a culprit in ffi_error

This commit is contained in:
Skgland
2025-08-09 21:10:28 +02:00
committed by Bennet Bleßmann
parent 7b2bf73ba1
commit d1356db7e3
2 changed files with 19 additions and 16 deletions

View File

@@ -613,7 +613,7 @@ impl MachineState {
}
#[cfg(feature = "ffi")]
pub(super) fn ffi_error(&self, err: FfiError) -> MachineError {
pub(super) fn ffi_error(&self, err: FfiError, culprit: HeapCellValue) -> MachineError {
let error_atom = match err {
FfiError::ValueCast => atom!("value_cast"),
FfiError::ValueOutOfRange => atom!("value_out_of_range"),
@@ -628,7 +628,7 @@ impl MachineState {
FfiError::LayoutError => atom!("layout_error"),
FfiError::UnsupportedAbi => atom!("unsupported_abi"),
};
let stub = functor!(atom!("ffi_error"), [atom_as_cell(error_atom)]);
let stub = functor!(atom!("ffi_error"), [atom_as_cell(error_atom), cell(culprit)]);
MachineError {
stub,