Issue |
143065
|
Summary |
ubsan has stopped identifying a mismatch between static and dynamic type of an argument to typeid()
|
Labels |
new issue
|
Assignees |
|
Reporter |
ojhunt
|
A post on C++'s std-proposals said some clearly UB code did not trigger a sanitizer failure, which was somewhat confusion, but after investigating it's a regression since clang 20.
```cpp
#include <typeinfo>
struct Foo {
virtual ~Foo(){}
};
struct Bar {
virtual ~Bar(){}
};
int main(int arc, char**) {
Foo f;
Bar *b = reinterpret_cast<Bar*>(&f);
(void)typeid(*b);
return 0;
}
```
Compiling with `-fsanitize=undefined` and running reports an error in 20, but passes in trunk
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs