aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code/fmthe.c
diff options
context:
space:
mode:
Diffstat (limited to 'mps/code/fmthe.c')
-rw-r--r--mps/code/fmthe.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/mps/code/fmthe.c b/mps/code/fmthe.c
index bf37111e7a5..2e291b52553 100644
--- a/mps/code/fmthe.c
+++ b/mps/code/fmthe.c
@@ -36,6 +36,7 @@ static mps_res_t dylan_header_scan(mps_ss_t mps_ss,
36 int header = *(int*)((char*)p - headerSIZE); 36 int header = *(int*)((char*)p - headerSIZE);
37 switch(headerType(header)) { 37 switch(headerType(header)) {
38 case realTYPE: 38 case realTYPE:
39 assert(header == realHeader);
39 break; 40 break;
40 case padTYPE: 41 case padTYPE:
41 p = (mps_addr_t)((char*)p + headerPadSize(header)); 42 p = (mps_addr_t)((char*)p + headerPadSize(header));
@@ -66,6 +67,7 @@ static mps_res_t dylan_header_scan_weak(mps_ss_t mps_ss,
66 header = *(int*)((char*)base - headerSIZE); 67 header = *(int*)((char*)base - headerSIZE);
67 switch(headerType(header)) { 68 switch(headerType(header)) {
68 case realTYPE: 69 case realTYPE:
70 assert(header == realHeader);
69 break; 71 break;
70 case padTYPE: 72 case padTYPE:
71 base = (mps_addr_t)((char*)base + headerPadSize(header)); 73 base = (mps_addr_t)((char*)base + headerPadSize(header));
@@ -92,6 +94,7 @@ static mps_addr_t dylan_header_skip(mps_addr_t object)
92 header = *(int*)((char*)object - headerSIZE); 94 header = *(int*)((char*)object - headerSIZE);
93 switch(headerType(header)) { 95 switch(headerType(header)) {
94 case realTYPE: 96 case realTYPE:
97 assert(header == realHeader);
95 break; 98 break;
96 case padTYPE: 99 case padTYPE:
97 return (mps_addr_t)((char*)object + headerPadSize(header)); 100 return (mps_addr_t)((char*)object + headerPadSize(header));
@@ -114,6 +117,8 @@ static mps_addr_t dylan_header_isfwd(mps_addr_t object)
114 if (headerType(header) != realTYPE) 117 if (headerType(header) != realTYPE)
115 return NULL; 118 return NULL;
116 119
120 assert(header == realHeader);
121
117 return dylan_format->isfwd(object); 122 return dylan_format->isfwd(object);
118} 123}
119 124
@@ -199,18 +204,18 @@ mps_res_t HeaderWeakFormatCheck(mps_addr_t addr)
199 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>. 204 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
200 * All rights reserved. This is an open source license. Contact 205 * All rights reserved. This is an open source license. Contact
201 * Ravenbrook for commercial licensing options. 206 * Ravenbrook for commercial licensing options.
202 * 207 *
203 * Redistribution and use in source and binary forms, with or without 208 * Redistribution and use in source and binary forms, with or without
204 * modification, are permitted provided that the following conditions are 209 * modification, are permitted provided that the following conditions are
205 * met: 210 * met:
206 * 211 *
207 * 1. Redistributions of source code must retain the above copyright 212 * 1. Redistributions of source code must retain the above copyright
208 * notice, this list of conditions and the following disclaimer. 213 * notice, this list of conditions and the following disclaimer.
209 * 214 *
210 * 2. Redistributions in binary form must reproduce the above copyright 215 * 2. Redistributions in binary form must reproduce the above copyright
211 * notice, this list of conditions and the following disclaimer in the 216 * notice, this list of conditions and the following disclaimer in the
212 * documentation and/or other materials provided with the distribution. 217 * documentation and/or other materials provided with the distribution.
213 * 218 *
214 * 3. Redistributions in any form must be accompanied by information on how 219 * 3. Redistributions in any form must be accompanied by information on how
215 * to obtain complete source code for this software and any accompanying 220 * to obtain complete source code for this software and any accompanying
216 * software that uses this software. The source code must either be 221 * software that uses this software. The source code must either be
@@ -221,7 +226,7 @@ mps_res_t HeaderWeakFormatCheck(mps_addr_t addr)
221 * include source code for modules or files that typically accompany the 226 * include source code for modules or files that typically accompany the
222 * major components of the operating system on which the executable file 227 * major components of the operating system on which the executable file
223 * runs. 228 * runs.
224 * 229 *
225 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 230 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
226 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 231 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
227 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 232 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR