Browse code

bb#11265 - fixed clambc referencing obsolete option

Kevin Lin authored on 2015/02/20 01:03:33
Showing 1 changed files
... ...
@@ -246,7 +246,7 @@ int main(int argc, char *argv[])
246 246
     FILE *f;
247 247
     struct cli_bc *bc;
248 248
     struct cli_bc_ctx *ctx;
249
-    int rc, dbgargc;
249
+    int rc, dbgargc, bc_stats=0;
250 250
     struct optstruct *opts;
251 251
     const struct optstruct *opt;
252 252
     unsigned funcid=0, i;
... ...
@@ -319,8 +319,15 @@ int main(int argc, char *argv[])
319 319
     bcs.all_bcs = bc;
320 320
     bcs.count = 1;
321 321
 
322
-    rc = cli_bytecode_load(bc, f, NULL, optget(opts, "trust-bytecode")->enabled, 
323
-			   optget(opts, "bytecode-statistics")->enabled);
322
+    if((opt = optget(opts, "statistics"))->enabled) {
323
+	while(opt) {
324
+	    if (!strcasecmp(opt->strarg, "bytecode"))
325
+		bc_stats=1;
326
+	    opt = opt->nextarg;
327
+        }
328
+    }
329
+
330
+    rc = cli_bytecode_load(bc, f, NULL, optget(opts, "trust-bytecode")->enabled, bc_stats);
324 331
     if (rc != CL_SUCCESS) {
325 332
 	fprintf(stderr,"Unable to load bytecode: %s\n", cl_strerror(rc));
326 333
 	optfree(opts);