Skip to content

Commit d82bb30

Browse files
committed
test
1 parent fba2ffe commit d82bb30

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

hugr-llvm/src/extension/collections/borrow_array.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,9 @@ pub fn build_none_borrowed_check<'c, H: HugrView<Node = Node>>(
719719
offset: IntValue<'c>,
720720
size: u64,
721721
) -> Result<()> {
722+
if size == 0 {
723+
return Ok(())
724+
}
722725
// Wrap the check into a function instead of inlining
723726
const FUNC_NAME: &str = "__barray_check_none_borrowed";
724727
let usize_t = usize_ty(&ctx.typing_session());
@@ -764,6 +767,9 @@ pub fn build_all_borrowed_check<'c, H: HugrView<Node = Node>>(
764767
offset: IntValue<'c>,
765768
size: u64,
766769
) -> Result<()> {
770+
if size == 0 {
771+
return Ok(())
772+
}
767773
// Wrap the check into a function instead of inlining
768774
const FUNC_NAME: &str = "__barray_check_all_borrowed";
769775
let usize_t = usize_ty(&ctx.typing_session());
@@ -1486,7 +1492,6 @@ pub fn emit_barray_unsafe_op<'c, H: HugrView<Node = Node>>(
14861492

14871493
#[cfg(test)]
14881494
mod test {
1489-
use hugr_core::Wire;
14901495
use hugr_core::builder::{DataflowHugr, HugrBuilder};
14911496
use hugr_core::extension::prelude::either_type;
14921497
use hugr_core::ops::Tag;
@@ -1496,6 +1501,7 @@ mod test {
14961501
self, BArrayOpBuilder, BArrayRepeat, BArrayScan, borrow_array_type,
14971502
};
14981503
use hugr_core::types::Type;
1504+
use hugr_core::{Wire};
14991505
use hugr_core::{
15001506
builder::{Dataflow, DataflowSubContainer, SubContainer},
15011507
extension::{

0 commit comments

Comments
 (0)