Browse code

bytecode: successfully skip bytecodes that use unknown APIs

When unknown APIs are used, the bytecode is skipped.
However we were still checking that the number of loaded functions is correct,
and of course we were failing because when skipping the number of loaded functions is
0. Fix this by not checking the number of loaded functions when skipping a
bytecode.

Török Edvin authored on 2011/02/14 17:13:43
Showing 1 changed files
... ...
@@ -1558,7 +1558,7 @@ int cli_bytecode_load(struct cli_bc *bc, FILE *f, struct cli_dbio *dbio, int tru
1558 1558
     }
1559 1559
     free(buffer);
1560 1560
     cli_dbgmsg("Parsed %d functions\n", current_func);
1561
-    if (current_func != bc->num_func) {
1561
+    if (current_func != bc->num_func && bc->state != bc_skip) {
1562 1562
 	cli_errmsg("Loaded less functions than declared: %u vs. %u\n",
1563 1563
 		   current_func, bc->num_func);
1564 1564
 	return CL_EMALFDB;