Skip to content

Commit

Permalink
Merge be0ef17 into 0ebf1fe
Browse files Browse the repository at this point in the history
  • Loading branch information
asterite authored Aug 13, 2024
2 parents 0ebf1fe + be0ef17 commit 74f9fe0
Show file tree
Hide file tree
Showing 19 changed files with 415 additions and 10 deletions.
356 changes: 346 additions & 10 deletions compiler/noirc_evaluator/src/ssa/opt/die.rs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "unused_array_get_known_index_out_of_bounds"
type = "bin"
authors = [""]
compiler_version = ">=0.31.0"

[dependencies]
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
let array = [1, 2, 3];
let _ = array[10]; // Index out of bounds
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "unused_array_get_unknown_index_out_of_bounds"
type = "bin"
authors = [""]
compiler_version = ">=0.31.0"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x = "10"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main(x: Field) {
let array = [1, 2, 3];
let _ = array[x]; // Index out of bounds
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "unused_array_set_known_index_out_of_bounds"
type = "bin"
authors = [""]
compiler_version = ">=0.31.0"

[dependencies]
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
let mut array = [1, 2, 3];
array[10] = 1; // Index out of bounds
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "unused_array_set_unknown_index_out_of_bounds"
type = "bin"
authors = [""]
compiler_version = ">=0.31.0"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x = "10"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main(x: Field) {
let mut array = [1, 2, 3];
array[x] = 1; // Index out of bounds
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "unused_slice_get_known_index_out_of_bounds"
type = "bin"
authors = [""]
compiler_version = ">=0.31.0"

[dependencies]
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
let slice = &[1, 2, 3];
let _ = slice[10]; // Index out of bounds
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "unused_slice_get_unknown_index_out_of_bounds"
type = "bin"
authors = [""]
compiler_version = ">=0.31.0"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x = "10"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main(x: Field) {
let slice = &[1, 2, 3];
let _ = slice[x]; // Index out of bounds
}

0 comments on commit 74f9fe0

Please sign in to comment.