Pointer to invalid memory kept #1820
Labels
bugzilla
Issues migrated from bugzilla
compile-fail
Use [accepts-invalid] and [rejects-valid] instead
llvm-tools
All llvm tools that do not have corresponding tag
Extended Description
In tools/llvm-ld/llvm-ld.cpp, around line 353, a 'const char *' to a temporary
std::string is being stored, with the string going out of scope right after,
making that pointer invalid. Snippet:
I originally reported this problem on the llvm-commit list, because I was told
to do so, but maybe I should have opened a bug report anyway. See [1] and its
follow-ups for a simple fix.
Funnily, in my particular case, things still worked fine as long as I only had
one -l option. But with several such option, all pointers in 'args' pointed to
the exact same memory location, still containing the last library name
processed and gcc got called like "gcc -llib -llib -llib -llib".
[1] http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070430/
048734.html
The text was updated successfully, but these errors were encountered: