代码:
// 结构
struct SControlCards
{
std::vector<short> vecCards;
int iCount;
};
// 执行代码块
{
SControlCards Scontrol;
std::vector<SControlCards> vecControl; // 控牌结构体
vecControl.clear();
// 存进结构体
int index = 0;
for (int i = 0; i < m_DealCardCount * m_iPlayingCount; i++)
{
vecCards.push_back(m_cards[i]);
index++;
if (index % 12 == 0)
{
Scontrol.vecCards = vecCards;
Scontrol.iCount = m_pMakeCard->GetControlGroupsCount(vecCards);
vecControl.push_back(Scontrol); // 出现core
vecCards.clear();
}
}
}
coredump信息:
#0 0x000000000059135e in std::_Vector_base<short, std::allocator<short> >::_Vector_impl::_Vector_impl(std::allocator<short>&&) (this=0x20,
__a=<unknown type in xxx, CU 0x0, DIE 0x36710>) at /usr/include/c++/4.8.2/bits/stl_vector.h:97
#1 0x000000000058f9c1 in std::_Vector_base<short, std::allocator<short> >::_Vector_base(std::_Vector_base<short, std::allocator<short> >&&) (this=0x20,
__x=<unknown type in xxx, CU 0x0, DIE 0x345ae>) at /usr/include/c++/4.8.2/bits/stl_vector.h:143
#2 0x000000000058cce4 in std::vector<short, std::allocator<short> >::vector(std::vector<short, std::allocator<short> >&&) (this=0x20,
__x=<unknown type in xxx, CU 0x0, DIE 0x3117a>) at /usr/include/c++/4.8.2/bits/stl_vector.h:328
#3 0x00000000005e62bd in SControlCards::SControlCards(SControlCards&&) (this=0x20) at Game/def.h:389
#4 0x00000000005ece58 in std::_Construct<SControlCards<SControlCards> > (__p=0x20) at /usr/include/c++/4.8.2/bits/stl_construct.h:75
#5 0x00000000005ec10d in std::__uninitialized_copy<false>::__uninit_copy<std::move_iterator<SControlCards*>, SControlCards*> (__first=..., __last=...,
__result=0x0) at /usr/include/c++/4.8.2/bits/stl_uninitialized.h:75
#6 0x00000000005eb3d2 in std::uninitialized_copy<std::move_iterator<SControlCards*>, SControlCards*> (__first=..., __last=..., __result=0x0)
at /usr/include/c++/4.8.2/bits/stl_uninitialized.h:117
#7 0x00000000005e91bc in std::__uninitialized_copy_a<std::move_iterator<SControlCards*>, SControlCards*, SControlCards> (__first=..., __last=...,
__result=0x0) at /usr/include/c++/4.8.2/bits/stl_uninitialized.h:258
#8 0x00000000005e60a5 in std::__uninitialized_move_if_noexcept_a<SControlCards*, SControlCards*, std::allocator<SControlCards> > (
__first=0x7f1fc226c010, __last=0x7f1fe226c010, __result=0x0, __alloc=...) at /usr/include/c++/4.8.2/bits/stl_uninitialized.h:281
#9 0x00000000005e3238 in std::vector<SControlCards, std::allocator<SControlCards> >::_M_emplace_back_aux<SControlCards const&> (this=0x7ffe028a4a30)
at /usr/include/c++/4.8.2/bits/vector.tcc:412
#10 0x00000000005e0eef in std::vector<SControlCards, std::allocator<SControlCards> >::push_back (this=0x7ffe028a4a30, __x=...)
at /usr/include/c++/4.8.2/bits/stl_vector.h:911
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。