projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Port: Add Solaris string compat
[lttng-tools.git]
/
src
/
lib
/
lttng-ctl
/
filter
/
filter-visitor-generate-bytecode.c
diff --git
a/src/lib/lttng-ctl/filter/filter-visitor-generate-bytecode.c
b/src/lib/lttng-ctl/filter/filter-visitor-generate-bytecode.c
index 762d60464cc257e97c642bc7eb38c307e914937b..00c9adc16addaeb0a45d50f65551ec60ff745cd5 100644
(file)
--- a/
src/lib/lttng-ctl/filter/filter-visitor-generate-bytecode.c
+++ b/
src/lib/lttng-ctl/filter/filter-visitor-generate-bytecode.c
@@
-22,7
+22,8
@@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
-#include "align.h"
+#include <common/align.h>
+
#include "filter-bytecode.h"
#include "filter-ir.h"
#include "filter-ast.h"
#include "filter-bytecode.h"
#include "filter-ir.h"
#include "filter-ast.h"
@@
-33,7
+34,6
@@
#define max_t(type, a, b) ((type) ((a) > (b) ? (a) : (b)))
#endif
#define max_t(type, a, b) ((type) ((a) > (b) ? (a) : (b)))
#endif
-//#define INIT_ALLOC_SIZE PAGE_SIZE
#define INIT_ALLOC_SIZE 4
static
#define INIT_ALLOC_SIZE 4
static
@@
-222,7
+222,7
@@
int visit_node_load(struct filter_parser_ctx *ctx, struct ir_op *node)
if (!insn)
return -ENOMEM;
insn->op = FILTER_OP_LOAD_S64;
if (!insn)
return -ENOMEM;
insn->op = FILTER_OP_LOAD_S64;
-
*(int64_t *) insn->data = node->u.load.u.num
;
+
memcpy(insn->data, &node->u.load.u.num, sizeof(int64_t))
;
ret = bytecode_push(&ctx->bytecode, insn, 1, insn_len);
free(insn);
return ret;
ret = bytecode_push(&ctx->bytecode, insn, 1, insn_len);
free(insn);
return ret;
@@
-237,7
+237,7
@@
int visit_node_load(struct filter_parser_ctx *ctx, struct ir_op *node)
if (!insn)
return -ENOMEM;
insn->op = FILTER_OP_LOAD_DOUBLE;
if (!insn)
return -ENOMEM;
insn->op = FILTER_OP_LOAD_DOUBLE;
-
*(double *) insn->data = node->u.load.u.flt
;
+
memcpy(insn->data, &node->u.load.u.flt, sizeof(double))
;
ret = bytecode_push(&ctx->bytecode, insn, 1, insn_len);
free(insn);
return ret;
ret = bytecode_push(&ctx->bytecode, insn, 1, insn_len);
free(insn);
return ret;
@@
-520,10
+520,19
@@
int recursive_visit_gen_bytecode(struct filter_parser_ctx *ctx,
LTTNG_HIDDEN
void filter_bytecode_free(struct filter_parser_ctx *ctx)
{
LTTNG_HIDDEN
void filter_bytecode_free(struct filter_parser_ctx *ctx)
{
- free(ctx->bytecode);
- ctx->bytecode = NULL;
- free(ctx->bytecode_reloc);
- ctx->bytecode_reloc = NULL;
+ if (!ctx) {
+ return;
+ }
+
+ if (ctx->bytecode) {
+ free(ctx->bytecode);
+ ctx->bytecode = NULL;
+ }
+
+ if (ctx->bytecode_reloc) {
+ free(ctx->bytecode_reloc);
+ ctx->bytecode_reloc = NULL;
+ }
}
LTTNG_HIDDEN
}
LTTNG_HIDDEN
This page took
0.027417 seconds
and
5
git commands to generate.