Module Name:    src
Committed By:   christos
Date:           Sat May  9 13:16:42 UTC 2015

Modified Files:
        src/sys/external/bsd/sljit/dist/test_src: sljitTest.c

Log Message:
CID 976986: NULL deref.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/sljit/dist/test_src/sljitTest.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/sljit/dist/test_src/sljitTest.c
diff -u src/sys/external/bsd/sljit/dist/test_src/sljitTest.c:1.5 src/sys/external/bsd/sljit/dist/test_src/sljitTest.c:1.6
--- src/sys/external/bsd/sljit/dist/test_src/sljitTest.c:1.5	Mon Feb 16 08:30:15 2015
+++ src/sys/external/bsd/sljit/dist/test_src/sljitTest.c	Sat May  9 09:16:42 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sljitTest.c,v 1.5 2015/02/16 13:30:15 alnsn Exp $	*/
+/*	$NetBSD: sljitTest.c,v 1.6 2015/05/09 13:16:42 christos Exp $	*/
 
 /*
  *    Stack-less Just-In-Time compiler
@@ -65,11 +65,18 @@ static sljit_si silent = 0;
 	}
 
 #define CHECK(compiler) \
-	if (sljit_get_compiler_error(compiler) != SLJIT_ERR_COMPILED) { \
-		printf("Compiler error: %d\n", sljit_get_compiler_error(compiler)); \
-		sljit_free_compiler(compiler); \
-		return; \
-	}
+	do { \
+		if (compiler == NULL) { \
+			printf("Can't create compiler\n"); \
+			return; \
+		} \
+		if (sljit_get_compiler_error(compiler) != SLJIT_ERR_COMPILED) { \
+			printf("Compiler error: %d\n", \
+			    sljit_get_compiler_error(compiler)); \
+			sljit_free_compiler(compiler); \
+			return; \
+		} \
+	} while (/*CONSTCOND*/0)
 
 static void cond_set(struct sljit_compiler *compiler, sljit_si dst, sljit_sw dstw, sljit_si type)
 {

Reply via email to