Assertions for Flexelint

It could infer that the result of a non-NULL cast of task->priv can not
be null, but it doesn't. Sigh.
parent d4fc3529
......@@ -164,7 +164,7 @@ match(VRT_CTX, vre_t *vre, VCL_STRING subject, struct vmod_priv *task,
}
else {
WS_Assert_Allocated(ctx->ws, task->priv, sizeof(*ov));
CAST_OBJ(ov, task->priv, OV_MAGIC);
CAST_OBJ_NOTNULL(ov, task->priv, OV_MAGIC);
}
len = strlen(subject);
......@@ -218,7 +218,7 @@ backref(VRT_CTX, VCL_INT refnum, VCL_STRING fallback, struct vmod_priv *task)
return fallback;
WS_Assert_Allocated(ctx->ws, task->priv, sizeof(*ov));
CAST_OBJ(ov, task->priv, OV_MAGIC);
CAST_OBJ_NOTNULL(ov, task->priv, OV_MAGIC);
refnum <<= 1;
assert(refnum + 1 < MAX_OV_USED);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment