mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-06 01:22:41 +00:00
stringFromIslObj: Do not crash when printing 'null' objects
No test case, as this code path is currently only used for debugging. llvm-svn: 252609
This commit is contained in:
parent
1e9ef81187
commit
b43cc62fe1
@ -74,7 +74,11 @@ static inline std::string stringFromIslObjInternal(__isl_keep ISLTy *isl_obj,
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user