Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not work on catching divide by zero error #37

Open
zhlila opened this issue Oct 9, 2018 · 0 comments
Open

Not work on catching divide by zero error #37

zhlila opened this issue Oct 9, 2018 · 0 comments

Comments

@zhlila
Copy link

zhlila commented Oct 9, 2018

static __attribute__ ((noinline)) void demo(int *fault) {
    COFFEE_TRY() {
        LOGD("_TEST", "num div:%d", 1 / (*fault));
        *fault = 0;
    } COFFEE_CATCH() {
        const char*const message = coffeecatch_get_message();
        snprintf(string_buffer, sizeof(string_buffer), "%s", message);
        *fault = 1;
    } COFFEE_END();
}

crash when *fault is 0
logcat is:
--------- beginning of crash 10-09 14:45:45.711 6975-6975/? A/libc: Fatal signal 8 (SIGFPE), code -6, fault addr 0x1b3f in tid 6975 (xample.hellojni)

My Phone is Nexus 5 Android 5.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant