#define R_DEBUG_BRAKE __asm__ ("int $3")
-#define ASSERT(__a__) do {if (!(__a__)) R_DEBUG_BRAKE; } while (0)
+#define R_ASSERT(__a__) do {if (!(__a__)) R_DEBUG_BRAKE; } while (0)
#define R_SIZE_ALIGN(s, n) ((((s) + (n) - 1) / (n)) * (n))
#define R_MIN(a, b) ((a) < (b) ? (a): (b))
#define R_MAX(a, b) ((a) > (b) ? (a): (b))
rlong r_harray_add(rharray_t *harray, const rchar *name, ruint namesize, rconstpointer pval)
{
rstr_t *membrName;
- rlong index;
+ rlong index, nameindex;
membrName = r_rstrdup(name, namesize);
index = r_carray_add(harray->members, pval);
- r_array_add(harray->names, &membrName);
+ nameindex = r_array_add(harray->names, &membrName);
+ /*
+ * Lets try to keep the name index and the data index in sync,
+ * if they are not, that might be a problem - we will have to
+ * think of some sort reverse lookup mechanism.
+ */
+ R_ASSERT(index == nameindex);
r_hash_insert_indexval(harray->hash, (rconstpointer)membrName, index);
return index;
}
* If the callbacks are not disabled we can also set the cache for the cases when they are disabled.
*/
if (!stat->cbmod) {
- ASSERT(&stat->mcache[RPA_MCACHEHASH(match, input, 1)] != mcache);
+ R_ASSERT(&stat->mcache[RPA_MCACHEHASH(match, input, 1)] != mcache);
RPA_MCACHE_SET(&stat->mcache[RPA_MCACHEHASH(match, input, 1)], match, input, ret, 1);
}
} else {
#define RVM_STACK_CHUNK 256
-#define RVM_ABORT(__cpu__, __e__) do { __cpu__->error = (__e__); (__cpu__)->abort = 1; ASSERT(0); return; } while (0)
+#define RVM_ABORT(__cpu__, __e__) do { __cpu__->error = (__e__); (__cpu__)->abort = 1; R_ASSERT(0); return; } while (0)
#define BIT(__shiftby__) (1 << (__shiftby__))
#define BITR(__f__, __l__, __r__) (((__r__) >= (__f__) && (__r__) <= (__l__)) ? BIT(__r__) : 0)
#define BITS(__f__, __l__) (BITR(__f__, __l__, R0)) | (BITR(__f__, __l__, R1)) | (BITR(__f__, __l__, R2)) | (BITR(__f__, __l__, R3)) | \
* We should never get here
*/
r_array_removelast(co->funcall);
- ASSERT(0);
+ R_ASSERT(0);
}
* We should never get here
*/
r_array_removelast(co->funcall);
- ASSERT(0);
+ R_ASSERT(0);
}
codegen_print_callback(stat, name, userdata, input, size, reason);
codegen_dump_code(rvm_codegen_getcode(co->cg, off), rvm_codegen_getcodesize(co->cg) - off);