mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 21:55:39 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user