summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2014-07-10 13:06:52 -0400
committerTom Stellard <[email protected]>2014-07-15 11:55:26 -0400
commit0d711e719e7c5b5a4a34521af97d84f3fb628efd (patch)
tree52bd1fcbf0957f847720bb94497162d7bd5802ca /src
parent20b431fd9eafa1336edbb9b1ab80327e2fce3532 (diff)
radeon/llvm: Fix LLVM diagnostic error reporting
We were trying to print the error message after disposing the message object. Tested-by and Reviewed-by: Aaron Watry <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeon/radeon_llvm_emit.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.c b/src/gallium/drivers/radeon/radeon_llvm_emit.c
index 6a394b265e4..1b17dd4613f 100644
--- a/src/gallium/drivers/radeon/radeon_llvm_emit.c
+++ b/src/gallium/drivers/radeon/radeon_llvm_emit.c
@@ -83,16 +83,13 @@ static LLVMTargetRef get_r600_target() {
#if HAVE_LLVM >= 0x0305
static void radeonDiagnosticHandler(LLVMDiagnosticInfoRef di, void *context) {
- unsigned int *diagnosticflag;
- char *diaginfo_message;
-
- diaginfo_message = LLVMGetDiagInfoDescription(di);
- LLVMDisposeMessage(diaginfo_message);
-
- diagnosticflag = (unsigned int *)context;
if (LLVMGetDiagInfoSeverity(di) == LLVMDSError) {
+ unsigned int *diagnosticflag = (unsigned int *)context;
+ char *diaginfo_message = LLVMGetDiagInfoDescription(di);
+
*diagnosticflag = 1;
fprintf(stderr,"LLVM triggered Diagnostic Handler: %s\n", diaginfo_message);
+ LLVMDisposeMessage(diaginfo_message);
}
}