Commit 957e4d74 authored by Maximilian Stemmer-Grabow's avatar Maximilian Stemmer-Grabow

Remove undefined behavior in array access test case

parent b8ef4af2
...@@ -2,11 +2,13 @@ class Main { ...@@ -2,11 +2,13 @@ class Main {
public static void main(String[] arguments) { public static void main(String[] arguments) {
Main main = new Main(); Main main = new Main();
main.getArray()[0] = 1; main.getArray()[0] = 1;
new Main().getArray()[0] = 2; new Main().getArray()[0] = 2;
} }
public int[] getArray() { public int[] getArray() {
return new int[0]; int[] result = new int[1];
result[0] = 42;
return result;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment