Skip to content

__builtin_*_overflow crashes with __intcap types #720

@arichardson

Description

@arichardson

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    clangClang C/C++ frontend issuescrash

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions