[polly] r252609 - stringFromIslObj: Do not crash when printing 'null' objects
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 10 07:09:44 PST 2015
Author: grosser
Date: Tue Nov 10 09:09:44 2015
New Revision: 252609
URL: http://llvm.org/viewvc/llvm-project?rev=252609&view=rev
Log:
stringFromIslObj: Do not crash when printing 'null' objects
No test case, as this code path is currently only used for debugging.
Modified:
polly/trunk/lib/Support/GICHelper.cpp
Modified: polly/trunk/lib/Support/GICHelper.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/GICHelper.cpp?rev=252609&r1=252608&r2=252609&view=diff
==============================================================================
--- polly/trunk/lib/Support/GICHelper.cpp (original)
+++ polly/trunk/lib/Support/GICHelper.cpp Tue Nov 10 09:09:44 2015
@@ -74,7 +74,11 @@ static inline std::string stringFromIslO
isl_printer *p = isl_printer_to_str(ctx);
printer_fn(p, isl_obj);
char *char_str = isl_printer_get_str(p);
- std::string string(char_str);
+ std::string string;
+ if (char_str)
+ string = char_str;
+ else
+ string = "null";
free(char_str);
isl_printer_free(p);
return string;
More information about the llvm-commits
mailing list