Skip to content

Commit

Permalink
fix out of bound error in integration tests (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
StringNick authored Mar 22, 2024
1 parent 954d12c commit 4afa756
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/integration_tests.zig
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,8 @@ pub fn main() void {
.{ .pathname = "cairo_programs/if_in_function.json", .layout = "all_cairo" },
.{ .pathname = "cairo_programs/if_list.json", .layout = "all_cairo" },
.{ .pathname = "cairo_programs/if_reloc_equal.json", .layout = "all_cairo" },
// TODO: panic index out of bounds
// .{ .pathname = "cairo_programs/integration_with_alloc_locals.json", .layout = "all_cairo" },
// TODO: panic index outt of bound
// .{ .pathname = "cairo_programs/integration.json", .layout = "all_cairo" },
.{ .pathname = "cairo_programs/integration_with_alloc_locals.json", .layout = "all_cairo" },
.{ .pathname = "cairo_programs/integration.json", .layout = "all_cairo" },
// TODO: not implemented hint
// .{ .pathname = "cairo_programs/inv_mod_p_uint512.json", .layout = "all_cairo" },

Expand Down Expand Up @@ -156,8 +154,7 @@ pub fn main() void {
// .{ .pathname = "cairo_programs/packed_sha256_test.json", .layout = "all_cairo" },
// TODO: hint not implemented sha256
// .{ .pathname = "cairo_programs/packed_sha256.json", .layout = "all_cairo" },
// TODO: panic index out of bounds
// .{ .pathname = "cairo_programs/pedersen_test.json", .layout = "all_cairo" },
.{ .pathname = "cairo_programs/pedersen_test.json", .layout = "all_cairo" },
.{ .pathname = "cairo_programs/pointers.json", .layout = "all_cairo" },
.{ .pathname = "cairo_programs/poseidon_builtin.json", .layout = "all_cairo" },
.{ .pathname = "cairo_programs/poseidon_hash.json", .layout = "all_cairo" },
Expand Down
2 changes: 1 addition & 1 deletion src/vm/builtins/builtin_runner/hash.zig
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ pub const HashBuiltinRunner = struct {
memory: *Memory,
) !?MaybeRelocatable {
// hash has already been processed
if ((address.offset <= self.verified_addresses.items.len) and self.verified_addresses.items[address.offset]) {
if ((address.offset < self.verified_addresses.items.len) and self.verified_addresses.items[address.offset]) {
return null;
}
if (address.offset % @as(u64, self.cells_per_instance) != 2) {
Expand Down

0 comments on commit 4afa756

Please sign in to comment.