Fix undefined behavior in Variable.h

m_loc_is_constant_data was uninitialized, so unless someone
explicitly called SetLocIsConstantData(), this would be UB.

I think every existing call-site would always call the proper
function to initialize the value, so there were no existing
bugs, but I encountered this when I tried to use it without
calling this function and encountered this.

llvm-svn: 348813
This commit is contained in:
Zachary Turner
2018-12-11 00:15:03 +00:00
parent 08e231dd9c
commit 9d76e42014

View File

@@ -50,7 +50,8 @@ Variable::Variable(
m_symfile_type_sp(symfile_type_sp), m_scope(scope),
m_owner_scope(context), m_scope_range(scope_range),
m_declaration(decl_ptr), m_location(location), m_external(external),
m_artificial(artificial), m_static_member(static_member) {}
m_artificial(artificial), m_loc_is_const_data(false),
m_static_member(static_member) {}
//----------------------------------------------------------------------
// Destructor