push_back() causes program to stop before entering main()

前端 未结 2 1877
一整个雨季
一整个雨季 2021-01-24 16:45

I\'m developing in c++ for my STM32F3 Discovery board and using std::deque as queue. After trying to debug my code (directly on device with ST-link or in simulator), the code ev

2条回答
  •  有刺的猬
    2021-01-24 17:36

    Try by checking if scale_buffer contains any element (scale_buffer.empty()) before calls to .back() and .front(): you are probably reading and writing some garbage, which makes the deque invalid, preparing the ground for a crash when you call push_back()

提交回复
热议问题