Rearrange some fields in structs to avoid holes.

0.96
Török Edvin 15 years ago
parent aa47fb3b9e
commit 2545f9767c
  1. 2
      libclamav/bytecode.h
  2. 22
      libclamav/bytecode_priv.h
  3. 2
      libclamav/bytecode_vm.c
  4. 2
      libclamav/matcher-ac.h
  5. 4
      libclamav/matcher.h
  6. 2
      libclamav/pdf.c

@ -56,12 +56,12 @@ struct cli_bc {
uint16_t *globaltys;
size_t num_globals;
enum bc_state state;
uint16_t start_tid;
struct bitset_tag *uses_apis;
char *lsig;
char *vnameprefix;
char **vnames;
unsigned vnames_cnt;
uint16_t start_tid;
struct cli_bc_dbgnode *dbgnodes;
unsigned dbgnode_cnt;
unsigned hook_lsig_id;

@ -39,8 +39,8 @@ typedef uint16_t funcid_t;
struct cli_bc_callop {
operand_t* ops;
uint16_t* opsizes;
uint8_t numOps;
funcid_t funcid;
uint8_t numOps;
};
struct branch {
@ -59,8 +59,8 @@ typedef uint8_t interp_op_t;
struct cli_bc_inst {
enum bc_opcode opcode;
uint16_t type;
interp_op_t interp_op;/* opcode for interpreter */
operand_t dest;
interp_op_t interp_op;/* opcode for interpreter */
union {
operand_t unaryop;
struct cli_bc_cast cast;
@ -96,8 +96,8 @@ struct cli_bc_func {
struct cli_bc_dbgnode_element {
unsigned nodeid;
char *string;
unsigned len;
char *string;
uint64_t constant;
};
@ -139,6 +139,8 @@ struct bc_jsnorm {
struct cli_bc_ctx {
uint8_t timeout;/* must be first byte in struct! */
uint16_t funcid;
unsigned numParams;
/* id and params of toplevel function called */
const struct cli_bc *bc;
const struct cli_bc_func *func;
@ -147,43 +149,41 @@ struct cli_bc_ctx {
uint16_t *opsizes;
char *values;
operand_t *operands;
uint16_t funcid;
unsigned numParams;
uint32_t file_size;
int outfd;
off_t off;
fmap_t *fmap;
fmap_t *save_map;
const char *virname;
struct cli_bc_hooks hooks;
const struct cli_exe_section *sections;
int outfd;
char *tempfile;
void *ctx;
unsigned written;
unsigned filewritten;
unsigned found;
unsigned ninflates;
bc_dbg_callback_trace trace;
bc_dbg_callback_trace_op trace_op;
bc_dbg_callback_trace_val trace_val;
bc_dbg_callback_trace_ptr trace_ptr;
unsigned trace_level;
const char *directory;
const char *file;
const char *scope;
unsigned trace_level;
uint32_t scopeid;
unsigned line;
unsigned col;
mpool_t *mpool;
struct bc_inflate* inflates;
unsigned ninflates;
struct bc_buffer *buffers;
unsigned nbuffers;
struct cli_hashset *hashsets;
unsigned nhashsets;
struct bc_jsnorm* jsnorms;
unsigned njsnorms;
char *jsnormdir;
unsigned jsnormwritten;
struct cli_hashset *hashsets;
struct bc_jsnorm* jsnorms;
char *jsnormdir;
struct cli_map *maps;
unsigned nmaps;
unsigned containertype;

@ -199,8 +199,8 @@ struct stack_entry {
struct stack_entry *prev;
const struct cli_bc_func *func;
operand_t ret;
struct cli_bc_bb *bb;
unsigned bb_inst;
struct cli_bc_bb *bb;
char *values;
};

@ -64,10 +64,10 @@ struct cli_ac_patt {
uint16_t parts, partno, special, special_pattern;
struct cli_ac_special **special_table;
struct cli_ac_patt *next, *next_same;
uint8_t depth;
uint16_t rtype, type;
uint32_t offdata[4], offset_min, offset_max;
uint32_t boundary;
uint8_t depth;
};
struct cli_ac_node {

@ -52,6 +52,7 @@ struct cli_lsig_tdb {
uint32_t *val, *range;
char *str;
uint32_t cnt[3];
uint32_t subsigs;
const uint32_t *target;
const uint32_t *engine, *nos, *ep, *filesize;
@ -62,7 +63,6 @@ struct cli_lsig_tdb {
*/
const char *icongrp1, *icongrp2;
uint32_t *macro_ptids;
uint32_t subsigs;
#ifdef USE_MPOOL
mpool_t *mempool;
#endif
@ -71,10 +71,10 @@ struct cli_lsig_tdb {
struct cli_bc;
struct cli_ac_lsig {
uint32_t id;
unsigned bc_idx;
char *logic;
const char *virname;
struct cli_lsig_tdb tdb;
unsigned bc_idx;
};
struct cli_matcher {

@ -121,10 +121,10 @@ struct pdf_obj {
struct pdf_struct {
struct pdf_obj *objs;
unsigned nobjs;
unsigned flags;
const char *map;
off_t size;
off_t offset;
unsigned flags;
cli_ctx *ctx;
const char *dir;
unsigned files;

Loading…
Cancel
Save