зеркало из https://github.com/mozilla/gecko-dev.git
NOT YET PART OF SEAMONKEY:
* committing fixes for shaver * header pointer is now set XPT_DoHeader * fixed assertion error in CHECK_COUNT macro
This commit is contained in:
Родитель
6db99a172d
Коммит
30a0f2ae51
|
@ -97,9 +97,8 @@ XPT_DoHeader(XPTCursor *cursor, XPTHeader **headerp)
|
||||||
header = PR_NEWZAP(XPTHeader);
|
header = PR_NEWZAP(XPTHeader);
|
||||||
if (!header)
|
if (!header)
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
} else {
|
}
|
||||||
header = *headerp;
|
*headerp = header;
|
||||||
}
|
|
||||||
|
|
||||||
if (mode == XPT_ENCODE) {
|
if (mode == XPT_ENCODE) {
|
||||||
/* IDEs appear after header, including annotations */
|
/* IDEs appear after header, including annotations */
|
||||||
|
|
|
@ -45,20 +45,21 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* XXX fail if XPT_DATA and !state->data_offset */
|
/* XXX fail if XPT_DATA and !state->data_offset */
|
||||||
#define CHECK_COUNT_(cursor, space) \
|
#define CHECK_COUNT_(cursor, space) \
|
||||||
/* if we're in the header, then exceeding the data_offset is illegal */ \
|
/* if we're in the header, then exceeding the data_offset is illegal */ \
|
||||||
((cursor)->pool == XPT_HEADER ? \
|
((cursor)->pool == XPT_HEADER ? \
|
||||||
((cursor)->offset - 1 + (space) > (cursor)->state->data_offset \
|
(ENCODING(cursor) && \
|
||||||
? (DBG(("no space left in HEADER %d + %d > %d\n", (cursor)->offset, \
|
((cursor)->offset - 1 + (space) > (cursor)->state->data_offset) \
|
||||||
(space), (cursor)->state->data_offset)), PR_FALSE) \
|
? (DBG(("no space left in HEADER %d + %d > %d\n", (cursor)->offset, \
|
||||||
: PR_TRUE) : \
|
(space), (cursor)->state->data_offset)), PR_FALSE) \
|
||||||
/* if we're in the data area and we're about to exceed the allocation */ \
|
: PR_TRUE) : \
|
||||||
(CURS_POOL_OFFSET(cursor) + (space) > (cursor)->state->pool->allocated ? \
|
/* if we're in the data area and we're about to exceed the allocation */ \
|
||||||
/* then grow if we're in ENCODE mode */ \
|
(CURS_POOL_OFFSET(cursor) + (space) > (cursor)->state->pool->allocated ? \
|
||||||
(ENCODING(cursor) ? XPT_GrowPool((cursor)->state->pool) \
|
/* then grow if we're in ENCODE mode */ \
|
||||||
/* and fail if we're in DECODE mode */ \
|
(ENCODING(cursor) ? XPT_GrowPool((cursor)->state->pool) \
|
||||||
: (DBG(("can't extend in DECODE")), PR_FALSE)) \
|
/* and fail if we're in DECODE mode */ \
|
||||||
/* otherwise we're OK */ \
|
: (DBG(("can't extend in DECODE")), PR_FALSE)) \
|
||||||
|
/* otherwise we're OK */ \
|
||||||
: PR_TRUE))
|
: PR_TRUE))
|
||||||
|
|
||||||
#define CHECK_COUNT(cursor, space) \
|
#define CHECK_COUNT(cursor, space) \
|
||||||
|
|
|
@ -97,9 +97,8 @@ XPT_DoHeader(XPTCursor *cursor, XPTHeader **headerp)
|
||||||
header = PR_NEWZAP(XPTHeader);
|
header = PR_NEWZAP(XPTHeader);
|
||||||
if (!header)
|
if (!header)
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
} else {
|
}
|
||||||
header = *headerp;
|
*headerp = header;
|
||||||
}
|
|
||||||
|
|
||||||
if (mode == XPT_ENCODE) {
|
if (mode == XPT_ENCODE) {
|
||||||
/* IDEs appear after header, including annotations */
|
/* IDEs appear after header, including annotations */
|
||||||
|
|
|
@ -45,20 +45,21 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* XXX fail if XPT_DATA and !state->data_offset */
|
/* XXX fail if XPT_DATA and !state->data_offset */
|
||||||
#define CHECK_COUNT_(cursor, space) \
|
#define CHECK_COUNT_(cursor, space) \
|
||||||
/* if we're in the header, then exceeding the data_offset is illegal */ \
|
/* if we're in the header, then exceeding the data_offset is illegal */ \
|
||||||
((cursor)->pool == XPT_HEADER ? \
|
((cursor)->pool == XPT_HEADER ? \
|
||||||
((cursor)->offset - 1 + (space) > (cursor)->state->data_offset \
|
(ENCODING(cursor) && \
|
||||||
? (DBG(("no space left in HEADER %d + %d > %d\n", (cursor)->offset, \
|
((cursor)->offset - 1 + (space) > (cursor)->state->data_offset) \
|
||||||
(space), (cursor)->state->data_offset)), PR_FALSE) \
|
? (DBG(("no space left in HEADER %d + %d > %d\n", (cursor)->offset, \
|
||||||
: PR_TRUE) : \
|
(space), (cursor)->state->data_offset)), PR_FALSE) \
|
||||||
/* if we're in the data area and we're about to exceed the allocation */ \
|
: PR_TRUE) : \
|
||||||
(CURS_POOL_OFFSET(cursor) + (space) > (cursor)->state->pool->allocated ? \
|
/* if we're in the data area and we're about to exceed the allocation */ \
|
||||||
/* then grow if we're in ENCODE mode */ \
|
(CURS_POOL_OFFSET(cursor) + (space) > (cursor)->state->pool->allocated ? \
|
||||||
(ENCODING(cursor) ? XPT_GrowPool((cursor)->state->pool) \
|
/* then grow if we're in ENCODE mode */ \
|
||||||
/* and fail if we're in DECODE mode */ \
|
(ENCODING(cursor) ? XPT_GrowPool((cursor)->state->pool) \
|
||||||
: (DBG(("can't extend in DECODE")), PR_FALSE)) \
|
/* and fail if we're in DECODE mode */ \
|
||||||
/* otherwise we're OK */ \
|
: (DBG(("can't extend in DECODE")), PR_FALSE)) \
|
||||||
|
/* otherwise we're OK */ \
|
||||||
: PR_TRUE))
|
: PR_TRUE))
|
||||||
|
|
||||||
#define CHECK_COUNT(cursor, space) \
|
#define CHECK_COUNT(cursor, space) \
|
||||||
|
|
Загрузка…
Ссылка в новой задаче