From 4e21def1a026caa2f860bf80ae47607b5a103cff Mon Sep 17 00:00:00 2001 From: David Mak Date: Mon, 6 Jan 2025 16:36:35 +0800 Subject: [PATCH] [artiq] symbol_resolver: Add missing promotion for host compilation Shape tuple is always in i32, so a zero-extension to i64 is necessary when assigning the shape tuple into the shape field of the ndarray. --- nac3artiq/src/symbol_resolver.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nac3artiq/src/symbol_resolver.rs b/nac3artiq/src/symbol_resolver.rs index 0f9d57bd..04d224cd 100644 --- a/nac3artiq/src/symbol_resolver.rs +++ b/nac3artiq/src/symbol_resolver.rs @@ -1131,7 +1131,10 @@ impl InnerResolver { super::CompileError::new_err(format!("Error getting element {i}: {e}")) })? .unwrap(); - let value = value.into_int_value(); + let value = ctx + .builder + .build_int_z_extend(value.into_int_value(), llvm_usize, "") + .unwrap(); Ok(value) }) .collect::, PyErr>>()?;