Skip to content

Commit 320ef61

Browse files
authored
Merge pull request #4408 from smowton/smowton/fix/multianewarray-line-numbers
multianewarray instruction: don't require a source line number
2 parents 589116d + 35f0b2e commit 320ef61

File tree

8 files changed

+34
-5
lines changed

8 files changed

+34
-5
lines changed
-12 Bytes
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
class A { }
Binary file not shown.

jbmc/regression/jbmc/multinewarray/multinewarray.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
class A
2-
{
3-
}
4-
51
class multinewarray
62
{
73
public static void main(String[] args)
Binary file not shown.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
class multinewarrayNoDebug
2+
{
3+
public static void main(String[] args)
4+
{
5+
int[][][] some_a = new int[4][3][2];
6+
7+
assert some_a.length==4;
8+
assert some_a[0].length==3;
9+
assert some_a[0][0].length==2;
10+
11+
int x=3;
12+
int y=5;
13+
int[][] int_array = new int[x][y];
14+
15+
for(int i=0; i<x; ++i)
16+
for(int j=0; j<x; ++j)
17+
int_array[i][j]=i+j;
18+
19+
assert int_array[2][1] == 3;
20+
A object_array[][] = new A[x][y];
21+
}
22+
}
23+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
multinewarrayNoDebug.class
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring
9+
--
10+
If recompiling the class file, use `-g:none` to eliminate all debug info, including line number tables.

jbmc/src/java_bytecode/java_bytecode_convert_method.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2430,7 +2430,6 @@ code_blockt java_bytecode_convert_methodt::convert_multianewarray(
24302430
const exprt::operandst &op,
24312431
exprt::operandst &results)
24322432
{
2433-
PRECONDITION(!location.get_line().empty());
24342433
const reference_typet ref_type = java_reference_type(arg0.type());
24352434
side_effect_exprt java_new_array(ID_java_new_array, ref_type, location);
24362435
java_new_array.operands() = op;

0 commit comments

Comments
 (0)