Change information
Commit message:
[test] Fix lifetime warnings in ComputeStackLimit
Stop doing pointer arithmetic on non-array variables, and use the
uintptr_t instead.
The old code was triggering Wlifetime-safety warnings on ToT Clang (in
addition to previously suppressed warnings on GCC):
test/cctest/test-api.cc:17441:23: error: address of stack memory is
returned later [-Werror,-Wlifetime-safety-return-stack-addr]
17441 | uint32_t* answer = &size - (size / sizeof(size));
| ^~~~
test/cctest/test-api.cc:17450:10: note: returned here
17450 | return answer;
| ^~~~~~
Bug: 482994758, 491707176
Change-Id: Ie76521013bc4bc4e9b9669c93252df39248be0ed
Cr-Commit-Position: refs/heads/main@{#106262}
Files:
- M test/cctest/test-api.cc
Change size: S
Delta: 1 file changed, 14 insertions(+), 25 deletions(-)
Branch: refs/heads/main
Submit Requirements:
Code-Review: +1 by Deepti Gandluri