Esempio n. 1
0
/**
* This is the main entry point of a native application that is using
* android_native_app_glue.  It runs in its own thread, with its own
* event loop for receiving input events and doing other things.
*/
void android_main(struct android_app* state) {

	int i = 0;
	int j = 0; //bp here

	switch (i)
	{
	case 1:
		divide_by_zero();
		break;
	case 2:
		segmentation_fault();
		break;

	}
}
Esempio n. 2
0
File: fpu_trig.c Progetto: kame/kame
static void
fxtract(void)
{
    FPU_REG *st_new_ptr;
    register FPU_REG *st1_ptr = FPU_st0_ptr;	/* anticipate */

    if (STACK_OVERFLOW) {
        stack_overflow();
        return;
    }
    if (!(FPU_st0_tag ^ TW_Valid)) {
        long    e;

#ifdef DENORM_OPERAND
        if ((FPU_st0_ptr->exp <= EXP_UNDER) && (denormal_operand()))
            return;
#endif				/* DENORM_OPERAND */

        push();
        reg_move(st1_ptr, FPU_st0_ptr);
        FPU_st0_ptr->exp = EXP_BIAS;
        e = st1_ptr->exp - EXP_BIAS;
        convert_l2reg(&e, st1_ptr);
        return;
    } else if (FPU_st0_tag == TW_Zero) {
        char    sign = FPU_st0_ptr->sign;
        divide_by_zero(SIGN_NEG, FPU_st0_ptr);
        push();
        reg_move(&CONST_Z, FPU_st0_ptr);
        FPU_st0_ptr->sign = sign;
        return;
    } else if (FPU_st0_tag == TW_Infinity) {
        char    sign = FPU_st0_ptr->sign;
        FPU_st0_ptr->sign = SIGN_POS;
        push();
        reg_move(&CONST_INF, FPU_st0_ptr);
        FPU_st0_ptr->sign = sign;
        return;
    } else if (FPU_st0_tag == TW_NaN) {
        if (!(FPU_st0_ptr->sigh & 0x40000000)) {	/* Signaling ? */
            EXCEPTION(EX_Invalid);
            /* Convert to a QNaN */
            FPU_st0_ptr->sigh |= 0x40000000;
        }
        push();
        reg_move(st1_ptr, FPU_st0_ptr);
        return;
    } else if (FPU_st0_tag == TW_Empty) {
        /* Is this the correct
         * behaviour? */
        if (control_word & EX_Invalid) {
            stack_underflow();
            push();
            stack_underflow();
        } else
            EXCEPTION(EX_StackUnder);
    }
#ifdef PARANOID
    else
        EXCEPTION(EX_INTERNAL | 0x119);
#endif				/* PARANOID */
}
Esempio n. 3
0
Rational::Rational(int a, int b)
        :n(a), d(b)
{
    if (b==0) throw divide_by_zero();
}