Skip to content

Commit 771bf6d

Browse files
author
Joel Allred
committed
Disable loop-less init of primitive arrays
This seems to not play very well with the interpreter at this point.
1 parent 8984eb9 commit 771bf6d

File tree

10 files changed

+30
-33
lines changed

10 files changed

+30
-33
lines changed

jbmc/regression/jbmc/NondetArrayPrimitive/boolArray.desc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
NondetArrayPrimitive.class
33
--function NondetArrayPrimitive.boolArray --max-nondet-array-length 2000 --unwind 1
44
^VERIFICATION FAILED$
@@ -10,3 +10,4 @@ Unwinding loop __CPROVER__start.0 iteration 2
1010
^warning: ignoring
1111
--
1212
Check no unwind needed to reach non-primitive array cell
13+
Skipped: Loop-less initialisation is disabled

jbmc/regression/jbmc/NondetArrayPrimitive/byteArray.desc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
NondetArrayPrimitive.class
33
--function NondetArrayPrimitive.byteArray --max-nondet-array-length 2000 --unwind 1
44
^VERIFICATION FAILED$
@@ -10,3 +10,4 @@ Unwinding loop __CPROVER__start.0 iteration 2
1010
^warning: ignoring
1111
--
1212
Check no unwind needed to reach non-primitive array cell
13+
Skipped: Loop-less initialisation is disabled

jbmc/regression/jbmc/NondetArrayPrimitive/charArray.desc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
NondetArrayPrimitive.class
33
--function NondetArrayPrimitive.charArray --max-nondet-array-length 2000 --unwind 1
44
^VERIFICATION FAILED$
@@ -10,3 +10,4 @@ Unwinding loop __CPROVER__start.0 iteration 2
1010
^warning: ignoring
1111
--
1212
Check no unwind needed to reach non-primitive array cell
13+
Skipped: Loop-less initialisation is disabled

jbmc/regression/jbmc/NondetArrayPrimitive/doubleArray.desc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
NondetArrayPrimitive.class
33
--function NondetArrayPrimitive.doubleArray --max-nondet-array-length 2000 --unwind 1
44
^VERIFICATION FAILED$
@@ -10,3 +10,4 @@ Unwinding loop __CPROVER__start.0 iteration 2
1010
^warning: ignoring
1111
--
1212
Check no unwind needed to reach non-primitive array cell
13+
Skipped: Loop-less initialisation is disabled

jbmc/regression/jbmc/NondetArrayPrimitive/floatArray.desc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
NondetArrayPrimitive.class
33
--function NondetArrayPrimitive.floatArray --max-nondet-array-length 2000 --unwind 1
44
^VERIFICATION FAILED$
@@ -10,3 +10,4 @@ Unwinding loop __CPROVER__start.0 iteration 2
1010
^warning: ignoring
1111
--
1212
Check no unwind needed to reach non-primitive array cell
13+
Skipped: Loop-less initialisation is disabled

jbmc/regression/jbmc/NondetArrayPrimitive/intArray.desc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
NondetArrayPrimitive.class
33
--function NondetArrayPrimitive.intArray --max-nondet-array-length 2000 --unwind 1
44
^VERIFICATION FAILED$
@@ -10,3 +10,4 @@ Unwinding loop __CPROVER__start.0 iteration 2
1010
^warning: ignoring
1111
--
1212
Check no unwind needed to reach non-primitive array cell
13+
Skipped: Loop-less initialisation is disabled

jbmc/regression/jbmc/NondetArrayPrimitive/intArrayMulti.desc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
NondetArrayPrimitive.class
33
--function NondetArrayPrimitive.intArrayMulti --max-nondet-array-length 51 --unwind 4
44
^VERIFICATION FAILED$
@@ -10,3 +10,4 @@ line 65 assertion.*: FAILURE
1010
--
1111
Check inner most array of multi-dimensional array is reachable independently of
1212
--unwind value.
13+
Skipped: Loop-less initialisation is disabled

jbmc/regression/jbmc/NondetArrayPrimitive/longArray.desc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
NondetArrayPrimitive.class
33
--function NondetArrayPrimitive.longArray --max-nondet-array-length 2000 --unwind 1
44
^VERIFICATION FAILED$
@@ -10,3 +10,4 @@ Unwinding loop __CPROVER__start.0 iteration 2
1010
^warning: ignoring
1111
--
1212
Check no unwind needed to reach non-primitive array cell
13+
Skipped: Loop-less initialisation is disabled

jbmc/regression/jbmc/NondetArrayPrimitive/shortArray.desc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
NondetArrayPrimitive.class
33
--function NondetArrayPrimitive.shortArray --max-nondet-array-length 2000 --unwind 1
44
^VERIFICATION FAILED$
@@ -10,3 +10,4 @@ Unwinding loop __CPROVER__start.0 iteration 2
1010
^warning: ignoring
1111
--
1212
Check no unwind needed to reach non-primitive array cell
13+
Skipped: Loop-less initialisation is disabled

jbmc/src/java_bytecode/java_object_factory.cpp

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,30 +1424,18 @@ void java_object_factoryt::gen_nondet_array_init(
14241424
init_array_expr =
14251425
typecast_exprt(init_array_expr, pointer_type(element_type));
14261426

1427-
if(element_type.id() == ID_pointer)
1428-
{
1429-
// For arrays of non-primitive types, nondeterministically initialize each
1430-
// element of the array
1431-
array_loop_init_code(
1432-
assignments,
1433-
init_array_expr,
1434-
length_expr,
1435-
element_type,
1436-
max_length_expr,
1437-
depth,
1438-
update_in_place,
1439-
location);
1440-
}
1441-
else
1442-
{
1443-
// Arrays of primitive types can be initialized with a single instruction
1444-
array_primitive_init_code(
1445-
assignments,
1446-
init_array_expr,
1447-
element_type,
1448-
max_length_expr,
1449-
location);
1450-
}
1427+
array_loop_init_code(
1428+
assignments,
1429+
init_array_expr,
1430+
length_expr,
1431+
element_type,
1432+
max_length_expr,
1433+
depth,
1434+
update_in_place,
1435+
location);
1436+
1437+
// TODO: Enable loop-less initialization of primitive arrays using
1438+
// array_primitive_init_code
14511439
}
14521440

14531441
/// We nondet-initialize enums to be equal to one of the constants defined

0 commit comments

Comments
 (0)