[compiler-rt] [asan] Make frame number checks more flexable (PR #94307)
Hau Hsu via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 13 22:07:48 PDT 2024
hau-hsu wrote:
> was that caused by unnecessary check.*.cpp ?
Yes. My bad.
I added `.*.cpp` because I got some FileCheck errors after I apply the `[0-9a-f]+` regex for frame numbers.
Then I thought they were caused by greedy matching of `*`.
For example, without `.*.cpp`, the checks are:
```
CHECK: {{ #[0-9]+ 0x.* in .*strncpy}}
CHECK: {{ #[0-9]+ 0x.* in main .*strncpy-overflow.cpp:}}[[@LINE-3]]
```
I got the error like:
```
error: CHECK: expected string not found in input
// CHECK: {{#[0-9]+ 0x.* in bad_function.*strcpy-overlap.cpp:}}[[@LINE+2]]
```
I thought the first check (`#[0-9]+ 0x.* in .*strncpy`) matches 2 lines
```
#0 0x2aaab49acc in strcpy .../asan_interceptors.cpp:554:5
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#1 0x2aaab98796 in bad_function() .../strcpy-overlap.cpp:42:3
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
So I added `.*.cpp` to prevent that.
But it seems that I shouldn't do this, and this is not the root cause of the error.
I'll review the patch and send it again. Sorry about that.
https://github.com/llvm/llvm-project/pull/94307
More information about the llvm-commits
mailing list