Skip to content

Commit 599fd66

Browse files
committed
Remove multiple function assertion
This commit removes an assertion that triggers when multiple functions get mangled to the same name when using the --export-file-local-symbols flag to goto-cc. This assertion was previously valid when compiling files one at a time, but commit fcd1083 introduced the possibility of compiling and linking several files at once. This is a problem when two source files both include an implementation file, like [1], because the implementation may contain static functions that get mangled twice. This commit replaces the assertion with a debug message in case users would like to check how often this happens. This commit fixes #5380. [1] https://github.com/awslabs/aws-c-common/blob/master/include/aws/common/atomics_gnu.inl
1 parent faf7f43 commit 599fd66

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/goto-programs/name_mangler.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,9 @@ class function_name_manglert
121121

122122
auto inserted = model.goto_functions.function_map.emplace(
123123
pair.second, std::move(found->second));
124-
INVARIANT(
125-
inserted.second,
126-
"The mangled name '" + std::string(pair.second.c_str()) +
127-
"' should not already exist in the codebase");
124+
if(!inserted.second)
125+
log.debug() << "Found a mangled name that already exists: "
126+
<< std::string(pair.second.c_str()) << log.eom;
128127

129128
model.goto_functions.function_map.erase(found);
130129
}

0 commit comments

Comments
 (0)