Author: yamakenz
Date: Tue Jul 17 21:20:50 2007
New Revision: 4732
Modified:
libgcroots-trunk/gcroots.c
Log:
* gcroots.c
- (GCROOTS_fin, GCROOTS_call_with_gc_ready_stack,
GCROOTS_is_protected_context, GCROOTS_mark, GCROOTS_is_protected): Add
precondition for args
Modified: libgcroots-trunk/gcroots.c
==============================================================================
--- libgcroots-trunk/gcroots.c (original)
+++ libgcroots-trunk/gcroots.c Tue Jul 17 21:20:50 2007
@@ -87,6 +87,8 @@
void
GCROOTS_fin(GCROOTS_context *ctx)
{
+ assert(ctx);
+
/* Nothing to do for this implementation. Caller must free ctx. */
}
@@ -98,6 +100,9 @@
word stack_top; /* approx */
volatile GCROOTS_user_proc anti_inline_proc;
+ assert(ctx);
+ assert(proc);
+
if (!ctx->stack_base) {
ctx->stack_base = &stack_top;
#ifdef IA64
@@ -121,12 +126,16 @@
int
GCROOTS_is_protected_context(GCROOTS_context *ctx)
{
+ assert(ctx);
+
return (ctx->stack_base) ? TRUE : FALSE;
}
void
GCROOTS_mark(GCROOTS_context *ctx)
{
+ assert(ctx);
+
GC_push_regs_and_stack((ptr_t)ctx);
}
@@ -134,6 +143,8 @@
GCROOTS_is_protected(GCROOTS_context *ctx, void *obj)
{
GCROOTS_context tmp_ctx;
+
+ assert(ctx);
if (!GCROOTS_is_protected_context(ctx))
return FALSE;