Skip to content

Commit 6b684f7

Browse files
Move function-pointer-can-be-null option handling.
Move it to recursive_initialization_configt because it's a common option.
1 parent 6eb5990 commit 6b684f7

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/goto-harness/function_call_harness_generator.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,18 @@ void function_call_harness_generatort::handle_option(
196196
.end()),
197197
[](const std::string &opt) -> irep_idt { return irep_idt{opt}; });
198198
}
199+
else if(option == COMMON_HARNESS_GENERATOR_FUNCTION_POINTER_CAN_BE_NULL_OPT)
200+
{
201+
std::transform(
202+
values.begin(),
203+
values.end(),
204+
std::inserter(
205+
p_impl->recursive_initialization_config
206+
.potential_null_function_pointers,
207+
p_impl->recursive_initialization_config.potential_null_function_pointers
208+
.end()),
209+
[](const std::string &opt) -> irep_idt { return irep_idt{opt}; });
210+
}
199211
else
200212
{
201213
throw invalid_command_line_argument_exceptiont{

src/goto-harness/recursive_initialization.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Author: Diffblue Ltd.
2121
#include <util/string2int.h>
2222

2323
#include <functional>
24+
#include <iterator>
2425

2526
bool recursive_initialization_configt::handle_option(
2627
const std::string &option,
@@ -74,6 +75,17 @@ bool recursive_initialization_configt::handle_option(
7475
COMMON_HARNESS_GENERATOR_MIN_ARRAY_SIZE_OPT, values);
7576
return true;
7677
}
78+
else if(option == COMMON_HARNESS_GENERATOR_FUNCTION_POINTER_CAN_BE_NULL_OPT)
79+
{
80+
std::transform(
81+
values.begin(),
82+
values.end(),
83+
std::inserter(
84+
potential_null_function_pointers,
85+
potential_null_function_pointers.end()),
86+
[](const std::string &opt) -> irep_idt { return irep_idt{opt}; });
87+
return true;
88+
}
7789
return false;
7890
}
7991

0 commit comments

Comments
 (0)