Browse code

Don't fail if bytecode was skipped due to functionality level.

Török Edvin authored on 2010/02/14 01:21:33
Showing 2 changed files
... ...
@@ -434,7 +434,7 @@ static int parseHeader(struct cli_bc *bc, unsigned char *buffer, unsigned *linel
434 434
 	return CL_EMALFDB;
435 435
     }
436 436
     if (flevel != BC_FUNC_LEVEL) {
437
-	cli_dbgmsg("Skipping bytecode with functionality level: %u\n", flevel);
437
+	cli_dbgmsg("Skipping bytecode with functionality level: %u (current %u)\n", flevel, BC_FUNC_LEVEL);
438 438
 	return CL_BREAK;
439 439
     }
440 440
     /* Optimistic parsing, check for error only at the end.*/
... ...
@@ -1409,6 +1409,11 @@ static int cli_loadcbc(FILE *fs, struct cl_engine *engine, unsigned int *signo,
1409 1409
 	cli_errmsg("Unable to load %s bytecode: %s\n", dbname, cl_strerror(rc));
1410 1410
 	return rc;
1411 1411
     }
1412
+    if (bc->state == bc_skip) {
1413
+	cli_bytecode_destroy(bc);
1414
+	bcs->count--;
1415
+	return CL_SUCCESS;
1416
+    }
1412 1417
     bc->id = bcs->count;/* must set after _load, since load zeroes */
1413 1418
     sigs++;
1414 1419
     if (bc->kind == BC_LOGICAL || bc->lsig) {