Skip to content

Commit 73570b8

Browse files
author
Owen Jones
committed
Add command line option to turn off precise access paths
Quick hack to allow turning of precise access paths via a command line option. If this is still in the code in 2019 then shoot Chris Smowton and Nathan Phillips for allowing me to do it.
1 parent 767ab8b commit 73570b8

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

src/driver/sec_driver_parse_options.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#include <taint-analysis/taint_security_scanner.h>
6161

6262
#include <pointer-analysis/evs_pretty_printer.h>
63+
#include <pointer-analysis/local_value_set.h>
6364

6465
#include "sec_driver_parse_options.h"
6566

@@ -170,6 +171,11 @@ int sec_driver_parse_optionst::doit()
170171
return 6;
171172
}
172173

174+
if (cmdline.isset("do-not-use-precise-access-paths"))
175+
{
176+
local_value_sett::do_not_use_precise_access_paths = true;
177+
}
178+
173179
if (cmdline.isset("security-scanner"))
174180
{
175181
return taint_do_security_scan(

src/driver/sec_driver_parse_options.h

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class optionst;
4040
"(lvsa-summary-directory):" \
4141
"(local-value-set-analysis)(show-value-sets)(lvsa-function):" \
4242
"(security-scanner):" \
43+
"(do-not-use-precise-access-paths)" \
4344
"(rebuild-taint-cache)" \
4445
UI_MESSAGE_OPTIONS \
4546
JAVA_BYTECODE_LANGUAGE_OPTIONS \

src/pointer-analysis/external_value_set_expr.h

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <sstream>
1010
#include <util/std_expr.h>
11+
#include "local_value_set.h"
1112

1213
// An access path entry, indicating that an external object
1314
// was accessed using e.g. member-x--of-dereference (written
@@ -167,6 +168,8 @@ class external_value_set_exprt : public exprt
167168

168169
bool can_extend_to_precise() const
169170
{
171+
if(local_value_sett::do_not_use_precise_access_paths)
172+
return false;
170173
#ifdef DO_NOT_USE_PRECISE_EXTERNAL_VALUE_SETS
171174
return false;
172175
#else

src/pointer-analysis/local_value_set.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
// For documentation of members of `local_value_sett`, see the corresponding
1919
// header file, `local_value_set.h`.
2020

21+
bool local_value_sett::do_not_use_precise_access_paths = false;
22+
2123
void local_value_sett::make_union_adjusting_evs_types(
2224
object_mapt &dest,
2325
const object_mapt &src,

src/pointer-analysis/local_value_set.h

+8
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,21 @@ class local_value_sett : public value_sett
1717
public:
1818
typedef value_sett baset;
1919

20+
/// Quick hack to allow turning of precise access paths via a command line
21+
/// option. If this is still in the code in 2019 then shoot Chris Smowton
22+
/// and Nathan Phillips for allowing me to do it.
23+
static bool do_not_use_precise_access_paths;
24+
25+
2026
mutable bool precise_evs_curtailed_because_of_loop = false;
2127

2228
/// Determines whether we should export precise or per_field external value
2329
/// sets in function summaries.
2430
/// \return
2531
bool should_export_precise_external_value_sets() const
2632
{
33+
if(do_not_use_precise_access_paths)
34+
return false;
2735
#ifdef DO_NOT_USE_PRECISE_EXTERNAL_VALUE_SETS
2836
return false;
2937
#else

0 commit comments

Comments
 (0)