File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,13 @@ uint32_t GsymCreator::insertFile(StringRef Path,
29
29
llvm::sys::path::Style Style) {
30
30
llvm::StringRef directory = llvm::sys::path::parent_path (Path, Style);
31
31
llvm::StringRef filename = llvm::sys::path::filename (Path, Style);
32
- FileEntry FE (insertString (directory), insertString (filename));
32
+ // We must insert the strings first, then call the FileEntry constructor.
33
+ // If we inline the insertString() function call into the constructor, the
34
+ // call order is undefined due to parameter lists not having any ordering
35
+ // requirements.
36
+ const uint32_t Dir = insertString (directory);
37
+ const uint32_t Base = insertString (filename);
38
+ FileEntry FE (Dir, Base);
33
39
34
40
std::lock_guard<std::recursive_mutex> Guard (Mutex);
35
41
const auto NextIndex = Files.size ();
You can’t perform that action at this time.
0 commit comments