Commit e632d8a6 authored by Geoff Simmons's avatar Geoff Simmons

Fix a panic caused by the .synth() method when the VMOD is built with -O0.

This simply replaces the use of VRT_synth_strands() with
VRT_synth_blob(). That's more of a workaround than an explanation
of the problem.

Closes #2
parent 60ac6828
......@@ -604,8 +604,7 @@ vmod_reader_get(VRT_CTX, struct VPFX(file_reader) *rdr)
VCL_VOID
vmod_reader_synth(VRT_CTX, struct VPFX(file_reader) *rdr)
{
const char *p[0];
struct strands strands = { 1, p };
VCL_BLOB blob;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(rdr, FILE_READER_MAGIC);
......@@ -622,8 +621,9 @@ vmod_reader_synth(VRT_CTX, struct VPFX(file_reader) *rdr)
AN(rdr->flags & RDR_MAPPED);
AN(rdr->addr);
strands.p[0] = rdr->addr;
VRT_synth_page(ctx, &strands);
blob = VRT_blob(ctx, "VMOD file blob()", rdr->addr, rdr->info->len - 1,
VMOD_FILE_BLOB_MAGIC);
VRT_synth_blob(ctx, blob);
AZ(pthread_rwlock_unlock(rdr->lock));
return;
......
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