Skip to content

Commit c660109

Browse files
Merge pull request #1690 from hannes-steffenhagen-diffblue/goto_analyzer_develop-original_goto_location_fix
Fix usage of instruction source location
2 parents 3bdabf2 + 4edf8b6 commit c660109

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
int main(void)
2+
{
3+
return 0;
4+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
main.c
3+
--show-goto-functions --json-ui --store-goto-locations
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
\"originalGOTOLocation\": \"0\"
7+
--
8+
--
9+
10+
Checks that generated JSON contains
11+
original goto locations, if any
12+

src/goto-programs/show_goto_functions_json.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,16 @@ json_objectt show_goto_functions_jsont::convert(
6363
instruction_entry["instructionId"]=
6464
json_stringt(instruction.to_string());
6565

66-
if(instruction.code.source_location().is_not_nil())
66+
if(instruction.source_location.is_not_nil())
6767
{
6868
instruction_entry["sourceLocation"]=
69-
json(instruction.code.source_location());
69+
json(instruction.source_location);
7070

71-
if(instruction.code.source_location().get_goto_location()!="")
71+
if(!instruction.source_location.get_goto_location().empty())
7272
{
7373
instruction_entry["originalGOTOLocation"]=
74-
json_stringt(id2string(instruction.code.source_location().get_goto_location()));
74+
json_stringt(
75+
id2string(instruction.source_location.get_goto_location()));
7576
}
7677
}
7778

0 commit comments

Comments
 (0)