llvm-project/libunwind/test
Jorge Gorbe Moya 1ae8d81147 [libunwind] Fix memory leak in handling of DW_CFA_remember_state and DW_CFA_restore_state
parseInstructions() doesn't always process the whole set of DWARF
instructions for a frame. It will stop once the target PC is reached, or
if malformed instructions are found. So, for example, if we have an
instruction sequence like this:

```
<start>
...
DW_CFA_remember_state
...
DW_CFA_advance_loc past the location we're unwinding at (pcoffset in parseInstructions() main loop)
...
DW_CFA_restore_state
<end>
```

... the saved state will never be freed, even though the
DW_CFA_remember_state opcode has a matching DW_CFA_restore_state later
in the sequence.

This change adds code to free whatever is left on rememberStack after
parsing the CIE and the FDE instructions.

Differential Revision: https://reviews.llvm.org/D66904
2020-02-18 11:57:18 -08:00
..
libunwind Reland "Enable `-funwind-tables` flag when building libunwind" 2019-12-11 04:27:04 +03:00
CMakeLists.txt Reland "Enable `-funwind-tables` flag when building libunwind" 2019-12-11 04:27:04 +03:00
alignment.pass.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
libunwind_01.pass.cpp [libunwind] Adjust libunwind_01.pass.cpp test for ARM EHABI 2019-10-03 17:01:04 +00:00
libunwind_02.pass.cpp
lit.cfg [PPC64][libunwind] Fix r2 not properly restored 2019-05-16 06:49:13 +00:00
lit.site.cfg.in Reland "Enable `-funwind-tables` flag when building libunwind" 2019-12-11 04:27:04 +03:00
remember_state_leak.pass.sh.s [libunwind] Fix memory leak in handling of DW_CFA_remember_state and DW_CFA_restore_state 2020-02-18 11:57:18 -08:00
signal_frame.pass.cpp Reland "Enable `-funwind-tables` flag when building libunwind" 2019-12-11 04:27:04 +03:00
unw_getcontext.pass.cpp