下面是导致VS2013特快版崩溃的程序。同样的程序在gcc4.8上也能成功地编译和运行。在我看来,这是对窃听器的攻击。
#include<iostream>
#include<string>
struct x
{
public:
std::string s{};
//Does not crash if we replace above line with below one
//std::string s{"VS2013"};
int i{10};
public:
x() = default;
~x() = default;
x(const x& rhs) = default;
x& operator=(const x& rhs) = default;
};
int main()
{
x a;
std::cout << a.s << std::endl;
std::cout << a.i << std::endl;
return 0;
}我想知道我的假设是正确的还是遗漏了什么。
发布于 2014-08-14 05:03:23
安装vs 2013的最新服务包。它应该消失。
https://stackoverflow.com/questions/25300327
复制相似问题