Skip to content
Commit 56d69ef8 authored by Jorge Gorbe Moya's avatar Jorge Gorbe Moya
Browse files

[lldb] Make sure RegularExpression constructors always initialize member variables

The copy constructor of RegularExpression doesn't initialize m_comp_err. This causes an use-of-initialized-value error when a RegularExpression is copied: the copy constructor calls Compile, which calls Free to free the existing regex if needed, which in turn reads m_comp_err to check if there's any regex to be freed.

This change calls the default constructor from the other constructors to make sure members are always initialized with sensible values. This also avoids duplicating init logic, like the RegularExpression(llvm:StringRef) constructor does, which is error prone.

Differential Revision: https://reviews.llvm.org/D62334

llvm-svn: 361546
parent 30905a37
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment