summaryrefslogtreecommitdiff
path: root/execute.c
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2013-06-18 00:17:20 +0100
committerStephen Dolan <mu@netsoc.tcd.ie>2013-06-18 00:17:20 +0100
commit8c4d29ee3894ebb91c587d25ecc53d58d5a582e1 (patch)
tree898c4772b342899c7b4f10a3d34bb202948d10b4 /execute.c
parent2c13f4fe72cb48fe474ccef8708ec4301bf4910f (diff)
downloadjq-8c4d29ee3894ebb91c587d25ecc53d58d5a582e1.tar.gz
Remove some initialise-to-zero code.
This lets valgrind find more bugs - if a field isn't given a well-defined value valgrind will now find it instead of seeing it set to zero with memset.
Diffstat (limited to 'execute.c')
-rw-r--r--execute.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/execute.c b/execute.c
index 3be4abe..3a5512a 100644
--- a/execute.c
+++ b/execute.c
@@ -238,6 +238,7 @@ static void jq_reset(jq_state *jq) {
if (jv_get_kind(jq->path) != JV_KIND_INVALID)
jv_free(jq->path);
jq->path = jv_null();
+ jq->subexp_nest = 0;
}
@@ -660,9 +661,8 @@ jq_state *jq_init(void) {
jq = jv_mem_alloc_unguarded(sizeof(*jq));
if (jq == NULL)
return NULL;
- memset(jq, 0, sizeof(*jq));
- jq->debug_trace_enabled = 0;
- jq->initial_execution = 1;
+
+ jq->bc = 0;
stack_init(&jq->stk);
jq->stk_top = 0;