From 34698794dfbc5f8f8e757f9ea4d9afa051157ec7 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Tue, 9 May 2017 17:41:48 -0700 Subject: [PATCH] Need to allow for one spare encoding for the non-executed case with no suitable stores. --- loadrf.cc | 2 +- threads.cc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/loadrf.cc b/loadrf.cc index 2d5984a..52a08fb 100644 --- a/loadrf.cc +++ b/loadrf.cc @@ -18,7 +18,7 @@ LoadRF::LoadRF(EPRecord *_load, ConstGen *cg) : load(_load) { RecordSet *mrfSet=cg->getMayReadFromSet(load); uint numstores=mrfSet->getSize(); - numvars=NUMBITS(numstores-1); + numvars=NUMBITS(numstores); vars=(Constraint **)model_malloc(numvars*sizeof(Constraint *)); cg->getArrayNewVars(numvars, vars); } diff --git a/threads.cc b/threads.cc index 52b7ca9..a3497e0 100644 --- a/threads.cc +++ b/threads.cc @@ -24,6 +24,10 @@ /** Allocate a stack for a new thread. */ static void * stack_allocate(size_t size) { + // TODO: This could be a bug if we have programs that start threads + // in different orders. The solution is to use the same strategy + // the ALLOC action uses. + return snapshot_malloc(size); } -- 2.34.1