Commit cf180211 authored by Michael Beck's avatar Michael Beck
Browse files

BugFix: return an empty type name if retrieve_type_dbg is NULL

This fixes a Windows crash.

parent 12f3234c
......@@ -127,10 +127,11 @@ void ir_set_type_debug_retrieve(retrieve_type_dbg_func func)
void ir_retrieve_type_dbg_info(char *buffer, size_t buffer_size,
const type_dbg_info *tdbgi)
buffer[0] = '\0';
if (retrieve_type_dbg)
retrieve_type_dbg(buffer, buffer_size, tdbgi);
assert(buffer_size > 0);
buffer[buffer_size-1] = 0;
buffer[buffer_size-1] = '\0';
void ir_dbg_info_snprint(char *buf, size_t bufsize, const dbg_info *dbg)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment