Skip to content

Commit f131a83

Browse files
author
Peter Schrammel
committed
use source location of function in symbol table
1 parent 1ec9b57 commit f131a83

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/goto-diff/goto_diff_base.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,9 @@ void goto_difft::convert_function(
125125
json_objectt &result,
126126
const irep_idt &function_name) const
127127
{
128-
const goto_programt &program=
129-
goto_model2.goto_functions.function_map.at(function_name).body;
130-
if(!program.instructions.empty())
131-
{
132-
result["sourceLocation"]=
133-
json(program.instructions.begin()->source_location);
134-
}
128+
symbol_tablet::symbolst::const_iterator s_it=
129+
goto_model2.symbol_table.symbols.find(function_name);
130+
if(s_it!=goto_model2.symbol_table.symbols.end())
131+
result["sourceLocation"]=json(s_it->second.location);
135132
result["name"]=json_stringt(id2string(function_name));
136133
}

0 commit comments

Comments
 (0)