@@ -276,13 +276,14 @@ function_pointer_restrictionst::restrictionst function_pointer_restrictionst::
276
276
function_pointer_restrictionst::restrictionst
277
277
function_pointer_restrictionst::parse_function_pointer_restrictions_from_file (
278
278
const std::list<std::string> &filenames,
279
+ const goto_modelt &goto_model,
279
280
message_handlert &message_handler)
280
281
{
281
282
auto merged_restrictions = function_pointer_restrictionst::restrictionst{};
282
283
283
284
for (auto const &filename : filenames)
284
285
{
285
- auto const restrictions = read_from_file (filename, message_handler);
286
+ auto const restrictions = read_from_file (filename, goto_model, message_handler);
286
287
287
288
merged_restrictions = merge_function_pointer_restrictions (
288
289
std::move (merged_restrictions), restrictions.restrictions );
@@ -483,7 +484,7 @@ function_pointer_restrictionst function_pointer_restrictionst::from_options(
483
484
auto const restriction_file_opts =
484
485
options.get_list_option (RESTRICT_FUNCTION_POINTER_FROM_FILE_OPT);
485
486
file_restrictions = parse_function_pointer_restrictions_from_file (
486
- restriction_file_opts, message_handler);
487
+ restriction_file_opts, goto_model, message_handler);
487
488
typecheck_function_pointer_restrictions (goto_model, file_restrictions);
488
489
}
489
490
catch (const invalid_restriction_exceptiont &e)
@@ -512,7 +513,9 @@ function_pointer_restrictionst function_pointer_restrictionst::from_options(
512
513
}
513
514
514
515
function_pointer_restrictionst
515
- function_pointer_restrictionst::from_json (const jsont &json)
516
+ function_pointer_restrictionst::from_json (
517
+ const jsont &json,
518
+ const goto_modelt &goto_model)
516
519
{
517
520
function_pointer_restrictionst::restrictionst restrictions;
518
521
@@ -523,7 +526,9 @@ function_pointer_restrictionst::from_json(const jsont &json)
523
526
524
527
for (auto const &restriction : to_json_object (json))
525
528
{
526
- restrictions.emplace (irep_idt{restriction.first }, [&] {
529
+ std::string pointer_name =
530
+ resolve_pointer_name (restriction.first , goto_model);
531
+ restrictions.emplace (irep_idt{pointer_name}, [&] {
527
532
if (!restriction.second .is_array ())
528
533
{
529
534
throw deserialization_exceptiont{" Value of " + restriction.first +
@@ -553,6 +558,7 @@ function_pointer_restrictionst::from_json(const jsont &json)
553
558
554
559
function_pointer_restrictionst function_pointer_restrictionst::read_from_file (
555
560
const std::string &filename,
561
+ const goto_modelt &goto_model,
556
562
message_handlert &message_handler)
557
563
{
558
564
auto inFile = std::ifstream{filename};
@@ -564,7 +570,7 @@ function_pointer_restrictionst function_pointer_restrictionst::read_from_file(
564
570
" failed to read function pointer restrictions from " + filename};
565
571
}
566
572
567
- return from_json (json);
573
+ return from_json (json, goto_model );
568
574
}
569
575
570
576
jsont function_pointer_restrictionst::to_json () const
0 commit comments