some trivial assertions

This commit is contained in:
Enno Rehling 2016-02-19 18:25:21 +01:00
parent 77ed6f3722
commit 1e4b860a2e
2 changed files with 3 additions and 0 deletions

View File

@ -217,6 +217,7 @@ int resolve_faction(variant id, void *address)
result = -1; result = -1;
} }
} }
assert(address);
*(faction **)address = f; *(faction **)address = f;
return result; return result;
} }

View File

@ -58,6 +58,7 @@ resolve_fun resolver)
void ur_add(variant data, void *ptrptr, resolve_fun fun) void ur_add(variant data, void *ptrptr, resolve_fun fun)
{ {
assert(ptrptr);
if (ur_list == NULL) { if (ur_list == NULL) {
ur_list = malloc(BLOCKSIZE * sizeof(unresolved)); ur_list = malloc(BLOCKSIZE * sizeof(unresolved));
ur_begin = ur_current = ur_list; ur_begin = ur_current = ur_list;
@ -86,6 +87,7 @@ void resolve(void)
ur_list = ur; ur_list = ur;
continue; continue;
} }
assert(ur->ptrptr);
ur->resolve(ur->data, ur->ptrptr); ur->resolve(ur->data, ur->ptrptr);
++ur; ++ur;
} }