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