@@ -493,6 +493,13 @@ Function: java_bytecode_convert_methodt::convert_instructions
493
493
494
494
\*******************************************************************/
495
495
496
+ static unsigned get_bytecode_type_width (const typet& ty)
497
+ {
498
+ if (ty.id ()==ID_pointer)
499
+ return 32 ;
500
+ return ty.get_unsigned_int (ID_width);
501
+ }
502
+
496
503
codet java_bytecode_convert_methodt::convert_instructions (
497
504
const instructionst &instructions,
498
505
const code_typet &method_type)
@@ -1158,7 +1165,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
1158
1165
{
1159
1166
assert (!stack.empty () && results.empty ());
1160
1167
1161
- if (stack.back ().type (). get_unsigned_int (ID_width )==32 )
1168
+ if (get_bytecode_type_width ( stack.back ().type ())==32 )
1162
1169
op=pop (2 );
1163
1170
else
1164
1171
op=pop (1 );
@@ -1170,7 +1177,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
1170
1177
{
1171
1178
assert (!stack.empty () && results.empty ());
1172
1179
1173
- if (stack.back ().type (). get_unsigned_int (ID_width )==32 )
1180
+ if (get_bytecode_type_width ( stack.back ().type ())==32 )
1174
1181
op=pop (3 );
1175
1182
else
1176
1183
op=pop (2 );
@@ -1182,15 +1189,15 @@ codet java_bytecode_convert_methodt::convert_instructions(
1182
1189
{
1183
1190
assert (!stack.empty () && results.empty ());
1184
1191
1185
- if (stack.back ().type (). get_unsigned_int (ID_width )==32 )
1192
+ if (get_bytecode_type_width ( stack.back ().type ())==32 )
1186
1193
op=pop (2 );
1187
1194
else
1188
1195
op=pop (1 );
1189
1196
1190
1197
assert (!stack.empty ());
1191
1198
exprt::operandst op2;
1192
1199
1193
- if (stack.back ().type (). get_unsigned_int (ID_width )==32 )
1200
+ if (get_bytecode_type_width ( stack.back ().type ())==32 )
1194
1201
op2=pop (2 );
1195
1202
else
1196
1203
op2=pop (1 );
@@ -1387,7 +1394,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
1387
1394
// two-word item (i.e. a double or a long).
1388
1395
// http://cs.au.dk/~mis/dOvs/jvmspec/ref-pop2.html
1389
1396
if (statement==" pop2" &&
1390
- op[0 ].type (). get_unsigned_int (ID_width )==32 )
1397
+ get_bytecode_type_width ( op[0 ].type ())==32 )
1391
1398
pop (1 );
1392
1399
}
1393
1400
else if (statement==" instanceof" )
0 commit comments