Skip to content

Commit 9f7ed63

Browse files
tautschnigDaniel Kroening
authored and
Daniel Kroening
committed
expr2c: Add justifying comment for use of source_locationt::get_function()
Even though we use it as an index into a data structure, ambiguity is not a problem here.
1 parent ec3aebb commit 9f7ed63

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ansi-c/expr2c.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ void expr2ct::get_shorthands(const exprt &expr)
160160
irep_idt func;
161161

162162
const symbolt *symbol;
163+
// we use the source-level function name as a means to detect collisions,
164+
// which is ok, because this is about generating user-visible output
163165
if(!ns.lookup(symbol_id, symbol))
164166
func=symbol->location.get_function();
165167

0 commit comments

Comments
 (0)