From cb150cd014e7678f680f0285e3703335f6f9057c Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 3 Jul 2014 11:56:47 +0100 Subject: [PATCH] More assertions in dylan object format: 1. the limit of a padding object must be greater than its base 2. mustn't forward padding objects (These assertions would have helped us with job003848.) Copied from Perforce Change: 186797 ServerID: perforce.ravenbrook.com --- mps/code/fmtdy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mps/code/fmtdy.c b/mps/code/fmtdy.c index 5ec72159590..0cb4adea11d 100644 --- a/mps/code/fmtdy.c +++ b/mps/code/fmtdy.c @@ -517,10 +517,13 @@ static mps_res_t dylan_scan(mps_ss_t mps_ss, mps_addr_t base, mps_addr_t limit) { mps_res_t res; + mps_addr_t prev = base; while(base < limit) { + prev = base; res = dylan_scan1(mps_ss, &base); if(res) return res; + assert(prev < base); } assert(base == limit); @@ -717,6 +720,7 @@ static void dylan_fwd(mps_addr_t old, mps_addr_t new) mps_addr_t limit; assert(dylan_isfwd(old) == NULL); + assert((*(mps_word_t *)old & 3) == 0); /* mustn't forward padding objects */ assert(((mps_word_t)new & 3) == 0); p = (mps_word_t *)old;