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