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

__builtin_*_overflow crashes with __intcap types #720

Open
arichardson opened this issue Sep 11, 2023 · 0 comments
Open

__builtin_*_overflow crashes with __intcap types #720

arichardson opened this issue Sep 11, 2023 · 0 comments
Labels
clang Clang C/C++ frontend issues crash

Comments

@arichardson
Copy link
Member

We should either emit an error or perform the computation on the address part.

For example https://cheri-compiler-explorer.cl.cam.ac.uk/z/fj58sb:

#include <stdlib.h>

__intcap test(__intcap a, __intcap b) {
   __intcap ret;
   if (__builtin_add_overflow(a, b, &ret))
       abort();

   return ret;
}
@arichardson arichardson added crash clang Clang C/C++ frontend issues labels Sep 11, 2023
arichardson added a commit that referenced this issue Sep 12, 2023
This requires silencing a warning and explicitly casting in
__mul_overflowed to work around the crash encountered in
#720
arichardson added a commit to CTSRD-CHERI/libcxx that referenced this issue Sep 12, 2023
This requires silencing a warning and explicitly casting in
__mul_overflowed to work around the crash encountered in
CTSRD-CHERI/llvm-project#720
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang C/C++ frontend issues crash
Projects
None yet
Development

No branches or pull requests

1 participant