Browse code

Fix clambc -p.

Török Edvin authored on 2010/03/22 21:58:51
Showing 2 changed files
... ...
@@ -1579,6 +1579,7 @@ int cli_bytecode_init_jit(struct cli_all_bc *bcs, unsigned dconfmask)
1579 1579
     if (!bcs->engine)
1580 1580
 	return CL_EMEM;
1581 1581
     bcs->engine->EE = 0;
1582
+    bcs->engine->Listener = 0;
1582 1583
     return 0;
1583 1584
 }
1584 1585
 
... ...
@@ -1587,7 +1588,8 @@ int cli_bytecode_done_jit(struct cli_all_bc *bcs)
1587 1587
     LLVMApiScopedLock scopedLock;
1588 1588
     if (bcs->engine) {
1589 1589
 	if (bcs->engine->EE) {
1590
-	    bcs->engine->EE->UnregisterJITEventListener(bcs->engine->Listener);
1590
+	    if (bcs->engine->Listener)
1591
+		bcs->engine->EE->UnregisterJITEventListener(bcs->engine->Listener);
1591 1592
 	    delete bcs->engine->EE;
1592 1593
 	}
1593 1594
 	delete bcs->engine->Listener;
... ...
@@ -121,6 +121,7 @@ const struct clam_option __clam_options[] = {
121 121
     { NULL, "generate-config", 'g', TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMCONF, "", "" },
122 122
 
123 123
     { NULL, "force-interpreter", 'f', TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMBC, "Force using the interpreter instead of the JIT", "" },
124
+    { NULL, "trust-bytecode", 't', TYPE_BOOL, MATCH_BOOL, 1, NULL, 0, OPT_CLAMBC, "Trust loaded bytecode (default yes)", ""},
124 125
     { NULL, "bytecode-trust-all", 't', TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMSCAN, "Trust loaded bytecode (default: only if signed)", ""},
125 126
     { NULL, "info", 'i', TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMBC, "Load and print bytecode information without executing", ""},
126 127
     { NULL, "printsrc", 'p', TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMBC, "Print source code of bytecode", ""},