Commit b2c3ae0b authored by Aleksandr Platonov's avatar Aleksandr Platonov
Browse files

[Sema] Don't check bounds for function pointer

Currently, clang crashes with i386 target on the following code:
```
void f() {
  f + 0xdead000000000000UL;
}
```
This problem is similar to the problem fixed in D104424, but that fix can't handle function pointer case, because `getTypeSizeInCharsIfKnown()` says that size is known and equal to 0 for function type.

This patch prevents bounds checking for function pointer, thus fixes the crash.

Fixes https://github.com/llvm/llvm-project/issues/50463

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D122748
parent 6f20744b
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment