summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2012-02-22 08:49:08 +0000
committerkr.angelov <kr.angelov@gmail.com>2012-02-22 08:49:08 +0000
commit786bf883b7284d5d57fa002bb86600996feb8e50 (patch)
tree24dcebfdc8a1fb23bde6ee4d02be4b45326a088b
parent7ddd0d5f3e44efb39503375301adaed562ff358e (diff)
libpgf: the map curr_lindefs must be allocated from a temporary pool
-rw-r--r--src/runtime/c/pgf/reader.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/runtime/c/pgf/reader.c b/src/runtime/c/pgf/reader.c
index 2472aa1b0..e7de966f5 100644
--- a/src/runtime/c/pgf/reader.c
+++ b/src/runtime/c/pgf/reader.c
@@ -44,6 +44,7 @@ struct PgfReader {
GuIn* in;
GuExn* err;
GuPool* opool;
+ GuPool* tmp_pool;
GuSymTable* symtab;
PgfConcr* curr_concr;
GuMap* curr_lindefs;
@@ -692,7 +693,7 @@ pgf_read_new_PgfConcr(GuType* type, PgfReader* rdr, GuPool* pool,
concr->cncfuns =
pgf_read_new(rdr, gu_type(PgfCncFuns), pool, NULL);
GuMapType* lindefs_t = gu_type_cast(gu_type(PgfLinDefs), GuMap);
- rdr->curr_lindefs = gu_map_type_make(lindefs_t, pool);
+ rdr->curr_lindefs = gu_map_type_make(lindefs_t, rdr->tmp_pool);
pgf_read_into_map(lindefs_t, rdr, rdr->curr_lindefs);
GuMapType* ccats_t = gu_type_cast(gu_type(PgfCCatMap), GuMap);
concr->ccats =
@@ -816,6 +817,7 @@ pgf_new_reader(GuIn* in, GuPool* opool, GuPool* tmp_pool, GuExn* err)
{
PgfReader* rdr = gu_new(PgfReader, tmp_pool);
rdr->opool = opool;
+ rdr->tmp_pool = tmp_pool;
rdr->symtab = gu_new_symtable(opool, tmp_pool);
rdr->err = err;
rdr->in = in;