@@ -276,13 +276,15 @@ 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 =
287
+ read_from_file (filename, goto_model, message_handler);
286
288
287
289
merged_restrictions = merge_function_pointer_restrictions (
288
290
std::move (merged_restrictions), restrictions.restrictions );
@@ -487,7 +489,7 @@ function_pointer_restrictionst function_pointer_restrictionst::from_options(
487
489
auto const restriction_file_opts =
488
490
options.get_list_option (RESTRICT_FUNCTION_POINTER_FROM_FILE_OPT);
489
491
file_restrictions = parse_function_pointer_restrictions_from_file (
490
- restriction_file_opts, message_handler);
492
+ restriction_file_opts, goto_model, message_handler);
491
493
typecheck_function_pointer_restrictions (goto_model, file_restrictions);
492
494
}
493
495
catch (const invalid_restriction_exceptiont &e)
@@ -515,8 +517,9 @@ function_pointer_restrictionst function_pointer_restrictionst::from_options(
515
517
merge_function_pointer_restrictions (file_restrictions, name_restrictions))};
516
518
}
517
519
518
- function_pointer_restrictionst
519
- function_pointer_restrictionst::from_json (const jsont &json)
520
+ function_pointer_restrictionst function_pointer_restrictionst::from_json (
521
+ const jsont &json,
522
+ const goto_modelt &goto_model)
520
523
{
521
524
function_pointer_restrictionst::restrictionst restrictions;
522
525
@@ -527,7 +530,9 @@ function_pointer_restrictionst::from_json(const jsont &json)
527
530
528
531
for (auto const &restriction : to_json_object (json))
529
532
{
530
- restrictions.emplace (irep_idt{restriction.first }, [&] {
533
+ std::string pointer_name =
534
+ resolve_pointer_name (restriction.first , goto_model);
535
+ restrictions.emplace (irep_idt{pointer_name}, [&] {
531
536
if (!restriction.second .is_array ())
532
537
{
533
538
throw deserialization_exceptiont{" Value of " + restriction.first +
@@ -557,6 +562,7 @@ function_pointer_restrictionst::from_json(const jsont &json)
557
562
558
563
function_pointer_restrictionst function_pointer_restrictionst::read_from_file (
559
564
const std::string &filename,
565
+ const goto_modelt &goto_model,
560
566
message_handlert &message_handler)
561
567
{
562
568
auto inFile = std::ifstream{filename};
@@ -568,7 +574,7 @@ function_pointer_restrictionst function_pointer_restrictionst::read_from_file(
568
574
" failed to read function pointer restrictions from " + filename};
569
575
}
570
576
571
- return from_json (json);
577
+ return from_json (json, goto_model );
572
578
}
573
579
574
580
jsont function_pointer_restrictionst::to_json () const
0 commit comments