[llvm-commits] [llvm] r91046 - /llvm/trunk/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp
Jeffrey Yasskin
jyasskin at google.com
Thu Dec 10 08:47:34 PST 2009
Oops, sorry, thanks.
On Thu, Dec 10, 2009 at 2:01 AM, Torok Edwin <edwintorok at gmail.com> wrote:
> Author: edwin
> Date: Thu Dec 10 04:01:47 2009
> New Revision: 91046
>
> URL: http://llvm.org/viewvc/llvm-project?rev=91046&view=rev
> Log:
> Comparing std::string with NULL is a bad idea, so just check whether its empty.
>
> This code was crashing always with oprofile enabled, since it tried to create a StringRef
> out of NULL, which run strlen on NULL.
>
> Modified:
> llvm/trunk/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp
>
> Modified: llvm/trunk/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp?rev=91046&r1=91045&r2=91046&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp Thu Dec 10 04:01:47 2009
> @@ -76,7 +76,7 @@
> public:
> const char *getFilename(MDNode *Scope) {
> std::string &Filename = Filenames[Scope];
> - if (Filename == NULL) {
> + if (Filename.empty()) {
> DIScope S(Scope);
> Filename = S.getFilename();
> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list