static MONO_ALWAYS_INLINE void
frame_stack_pop (FrameStack *stack, StackFragment *frag, gpointer pos)
{
- g_assert ((guint8*)pos >= (guint8*)&frag->data && (guint8*)pos <= (guint8*)frag->end);
+ g_assert_checked ((guint8*)pos >= (guint8*)&frag->data && (guint8*)pos <= (guint8*)frag->end);
stack->current = frag;
mono_compiler_barrier ();
stack->current->pos = (guint8*)pos;
#endif
-#if defined(__GNUC__) && !defined(TARGET_WASM) && !COUNT_OPS && !DEBUG_INTERP
+#if defined(__GNUC__) && !defined(TARGET_WASM) && !COUNT_OPS && !DEBUG_INTERP && !ENABLE_CHECKED_BUILD
#define USE_COMPUTED_GOTO 1
#endif
*/
while (1) {
MintOpcode opcode;
- /* g_assert (sp >= frame->stack); */
- /* g_assert(vt_sp - vtalloc <= frame->imethod->vt_stack_size); */
+#ifdef ENABLE_CHECKED_BUILD
+ g_assert (sp >= frame->stack);
+ g_assert (vt_sp >= sp);
+ g_assert (locals >= vt_sp);
+#endif
DUMP_INSTR();
MINT_IN_SWITCH (*ip) {
MINT_IN_CASE(MINT_INITLOCALS)
// FIXME This can only happen in a few wrappers. Add separate opcode for it
*frame->retval = *sp;
}
+#ifdef ENABLE_CHECKED_BUILD
+ /* FIXME Fix these warnings and replace with assertions */
if (sp > frame->stack)
g_warning_d ("ret: more values on stack: %d", sp - frame->stack);
+#endif
goto exit_frame;
MINT_IN_CASE(MINT_RET_VOID)
+#ifdef ENABLE_CHECKED_BUILD
+ /* FIXME Fix these warnings and replace with assertions */
if (sp > frame->stack)
g_warning_ds ("ret.void: more values on stack: %d %s", sp - frame->stack, mono_method_full_name (frame->imethod->method, TRUE));
+#endif
goto exit_frame;
MINT_IN_CASE(MINT_RET_VT) {
gpointer dest_vt;
dest_vt = frame->retval->data.p;
}
memcpy (dest_vt, sp->data.p, i32);
+#ifdef ENABLE_CHECKED_BUILD
+ /* FIXME Fix these warnings and replace with assertions */
if (sp > frame->stack)
g_warning_d ("ret.vt: more values on stack: %d", sp - frame->stack);
+#endif
goto exit_frame;
}
exit_frame:
error_init_reuse (error);
- g_assert (frame->imethod);
+ g_assert_checked (frame->imethod);
if (clause_args && clause_args->base_frame) {
// We finished executing a filter. The execution stack of the base frame