Skip to content

Commit 77453e1

Browse files
fix: drop bogus i64 return from cairo_native__dict_squash MLIR call (#1638)
The MLIR `llvm.call` to `cairo_native__dict_squash` declared an i64 result, but the C function returns void. The declared result was unused and only harmless because dead-value elimination removed it; it is a genuine ABI mismatch that could surface at higher OptLevels. Remove `.add_results(...)` to match the void signature, matching the pattern of other void calls like `dict_into_entries`, and fix the copy-pasted doc comment. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c9b70b8 commit 77453e1

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/metadata/runtime_bindings.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -830,11 +830,9 @@ impl RuntimeBindingsMeta {
830830
Ok((is_present, value_ptr))
831831
}
832832

833-
/// Register if necessary, then invoke the `dict_gas_refund()` function.
833+
/// Register if necessary, then invoke the `dict_squash()` function.
834834
///
835-
/// Compute the total gas refund for the dictionary.
836-
///
837-
/// Returns a u64 of the result.
835+
/// Squash the dictionary in place, updating the range check and gas pointers.
838836
#[allow(clippy::too_many_arguments)]
839837
pub fn dict_squash<'c, 'a>(
840838
&mut self,
@@ -856,7 +854,6 @@ impl RuntimeBindingsMeta {
856854
OperationBuilder::new("llvm.call", location)
857855
.add_operands(&[function])
858856
.add_operands(&[dict_ptr, range_check_ptr, gas_ptr])
859-
.add_results(&[IntegerType::new(context, 64).into()])
860857
.build()?,
861858
))
862859
}

0 commit comments

Comments
 (0)