diff options
| author | jeffreytan81 <jeffreytan@meta.com> | 2023-10-24 08:44:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-24 08:44:34 -0700 |
| commit | 00d3ed6deadb1d647b70ab37ac66ada6a550c1ba (patch) | |
| tree | 773fbbae7207838bcdedeb06cf83acfed716a0e1 /lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.cpp | |
| parent | ec0645939b8eb84891bb0aef837b355a3139709a (diff) | |
[Reland] Detect against invalid variant index for LibStdC++ std::variant data formatters (#69614)
This is relanding of https://github.com/llvm/llvm-project/pull/69253.
`TestTemplatePackArgs.py` is passing now.
https://github.com/llvm/llvm-project/pull/68012/files added new data
formatters for LibStdC++ std::variant.
However, this formatter can crash if std::variant's index field has
invalid value (exceeds the number of template arguments).
This can happen if the current IP stops at a place std::variant is not
initialized yet.
This patch fixes the crash by ensuring the index is a valid value and
fix GetNthTemplateArgument() to make sure it is not crashing.
Co-authored-by: jeffreytan81 <jeffreytan@fb.com>
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.cpp')
0 files changed, 0 insertions, 0 deletions
