The unified diff between revisions [81f2a8bb..] and [697c3a55..] is displayed below. It can also be downloaded as a raw diff.

This diff has been restricted to the following files: 'src/lsi/vm.c'

#
# old_revision [81f2a8bbe94638a22f5651ee07112ceabd50285c]
# new_revision [697c3a55915ad7eda83ba73798ce0c4b8b2544ba]
#
# patch "src/lsi/vm.c"
#  from [e2e905076968e53dd131de512d042191f64d91bf]
#    to [6f62d2db74a2a4932bd876c11abeab092af42a19]
#
============================================================
--- src/lsi/vm.c	e2e905076968e53dd131de512d042191f64d91bf
+++ src/lsi/vm.c	6f62d2db74a2a4932bd876c11abeab092af42a19
@@ -472,18 +472,14 @@ int vm_intfn_cmdsocket_write(void)
 	char *buffer = stack_getstr(vm_current, len, 2);
 	int newoff;
 
-	printf("cmdsocket_write in vm\n");
-
 	newoff = cmdsocket_write(buffer, len, off);
 	stack_poke(vm_current, 1, newoff);
 
 	if (newoff != len) {
-		printf("cmdsocket_write sleeping\n");
 		vm_queue(vm_current, VM_CMDWRITEQ);
 		vm_current = NULL;
 		return 0;
 	}
-	printf("cmdsocket_write success\n");
 	return 1;
 }
 
@@ -865,7 +861,9 @@ void vm_load_file(char *filename)
 	char *ptr;
 
 	fh = fopen(filename, "r");
-	assert(fh != NULL);
+	if (fh == NULL) {
+		err(1, "Failed to open '%s'", filename);
+	}
 
 	for (ptr = vm_codearea; ptr < vm_codearea+vm_codesize; ptr++) {
 		int c;
@@ -891,16 +889,19 @@ void vm_init_functions(void)
 	struct hashentry *ptr;
 
 	/* First, let's check the magic */
-	assert(vm_codearea[0] == MAGIC1);
-	assert(vm_codearea[1] == MAGIC2);
-	assert(vm_codearea[2] == VERSION1);
-	assert(vm_codearea[3] == VERSION2);
+	if ((vm_codearea[0] != MAGIC1) ||
+	    (vm_codearea[1] != MAGIC2))
+		errx(1, "Bad magic - not a lightscript binary");
+	if ((vm_codearea[2] != VERSION1) ||
+	    (vm_codearea[3] != VERSION2))
+		errx(1, "Bad version - recompile");
 
-	assert(GETINT(vm_codearea, 8) == vm_abiversion1);
-	assert(GETINT(vm_codearea, 12) == vm_abiversion2);
-	assert(GETINT(vm_codearea, 16) == vm_abiversion3);
-	assert(GETINT(vm_codearea, 20) == vm_abiversion4);
-	assert(GETINT(vm_codearea, 24) == vm_abiversion5);
+	if ((GETINT(vm_codearea, 8) != vm_abiversion1) ||
+	    (GETINT(vm_codearea, 12) == vm_abiversion2) ||
+	    (GETINT(vm_codearea, 16) == vm_abiversion3) ||
+	    (GETINT(vm_codearea, 20) == vm_abiversion4) ||
+	    (GETINT(vm_codearea, 24) == vm_abiversion5))
+		errx(1, "Incompatible ABI version - recompile");
 
 	/* Now, get the function table pointer */
 	t = GETINT(vm_codearea, 4);