@@ -471,7 +471,7 @@ void goto_check_ct::mod_by_zero_check(
471
471
const mod_exprt &expr,
472
472
const guardt &guard)
473
473
{
474
- if (!enable_div_by_zero_check || mode == ID_java )
474
+ if (!enable_div_by_zero_check)
475
475
return ;
476
476
477
477
// add divison by zero subgoal
@@ -2052,35 +2052,6 @@ void goto_check_ct::goto_check(
2052
2052
}
2053
2053
else if (i.is_function_call ())
2054
2054
{
2055
- const auto &function = i.call_function ();
2056
-
2057
- // for Java, need to check whether 'this' is null
2058
- // on non-static method invocations
2059
- if (
2060
- mode == ID_java && enable_pointer_check &&
2061
- !i.call_arguments ().empty () && function.type ().id () == ID_code &&
2062
- to_code_type (function.type ()).has_this ())
2063
- {
2064
- exprt pointer = i.call_arguments ()[0 ];
2065
-
2066
- local_bitvector_analysist::flagst flags =
2067
- local_bitvector_analysis->get (current_target, pointer);
2068
-
2069
- if (flags.is_unknown () || flags.is_null ())
2070
- {
2071
- notequal_exprt not_eq_null (
2072
- pointer, null_pointer_exprt (to_pointer_type (pointer.type ())));
2073
-
2074
- add_guarded_property (
2075
- not_eq_null,
2076
- " this is null on method invocation" ,
2077
- " pointer dereference" ,
2078
- i.source_location (),
2079
- pointer,
2080
- guardt (true_exprt (), guard_manager));
2081
- }
2082
- }
2083
-
2084
2055
check (i.call_lhs ());
2085
2056
check (i.call_function ());
2086
2057
@@ -2250,12 +2221,6 @@ void goto_check_ct::goto_check(
2250
2221
instruction.source_location_nonconst ().set_column (
2251
2222
it->source_location ().get_column ());
2252
2223
}
2253
-
2254
- if (!it->source_location ().get_java_bytecode_index ().empty ())
2255
- {
2256
- instruction.source_location_nonconst ().set_java_bytecode_index (
2257
- it->source_location ().get_java_bytecode_index ());
2258
- }
2259
2224
}
2260
2225
}
2261
2226
@@ -2286,12 +2251,6 @@ goto_check_ct::get_pointer_points_to_valid_memory_conditions(
2286
2251
2287
2252
conditionst conditions;
2288
2253
2289
- if (mode == ID_java)
2290
- {
2291
- // The following conditions don’t apply to Java
2292
- return conditions;
2293
- }
2294
-
2295
2254
const exprt in_bounds_of_some_explicit_allocation =
2296
2255
is_in_bounds_of_some_explicit_allocation (address, size);
2297
2256
@@ -2365,24 +2324,17 @@ goto_check_ct::get_pointer_is_null_condition(
2365
2324
{
2366
2325
PRECONDITION (local_bitvector_analysis);
2367
2326
PRECONDITION (address.type ().id () == ID_pointer);
2368
- const auto &pointer_type = to_pointer_type (address.type ());
2369
2327
local_bitvector_analysist::flagst flags =
2370
2328
local_bitvector_analysis->get (current_target, address);
2371
- if (mode == ID_java)
2372
- {
2373
- if (flags.is_unknown () || flags.is_null ())
2374
- {
2375
- notequal_exprt not_eq_null (address, null_pointer_exprt{pointer_type});
2376
- return {conditiont{not_eq_null, " reference is null" }};
2377
- }
2378
- }
2379
- else if (flags.is_unknown () || flags.is_uninitialized () || flags.is_null ())
2329
+
2330
+ if (flags.is_unknown () || flags.is_uninitialized () || flags.is_null ())
2380
2331
{
2381
2332
return {conditiont{
2382
2333
or_exprt{is_in_bounds_of_some_explicit_allocation (address, size),
2383
2334
not_exprt (null_pointer (address))},
2384
2335
" pointer NULL" }};
2385
2336
}
2337
+
2386
2338
return {};
2387
2339
}
2388
2340
0 commit comments