Skip to content

Opening a special code can cause memory to rise and crash #10904

Open
@WiseAnswer

Description

@WiseAnswer

Environment

  • OS and Version: Windows 11 22621.1555
  • VS Code Version: 1.77.3
  • C/C++ Extension Version: v1.14.5
  • If using SSH remote, specify OS of remote machine:

Bug Summary and Steps to Reproduce

Bug Summary:
Opening a special code can cause memory to rise and crash

Steps to reproduce:

  1. Create a new .cpp file
  2. Copy the following code to this file
#include<bits/stdc++.h>
using namespace std;
template <int n>
struct a
{
};
template <size_t... i>
unsigned long long a1(index_sequence<i...>, int n)
{
    constexpr std::array<unsigned long long, sizeof...(i)> ret = {tmp<i>::val...};
    return ret[n];
};
unsigned long long a2(int n)
{
    return a1(make_index_sequence<2000000000>(), n);
}

Expected behavior:
Rapid increase in memory usage

Configuration and Logs

-------- Diagnostics - 2023/5/1 10:56:23
Version: 1.14.5
Current Configuration:
{
    "name": "Win32",
    "includePath": [
        "c:\\Users\\WiseAnswer\\Desktop/**"
    ],
    "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
    ],
    "windowsSdkVersion": "10.0.22621.0",
    "cStandard": "c11",
    "cppStandard": "c++14",
    "intelliSenseMode": "windows-gcc-x64",
    "intelliSenseModeIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "mergeConfigurations": false,
    "compilerPath": "C:\\Program Files\\mingw64\\bin\\g++.exe",
    "compilerPathIsExplicit": true,
    "browse": {
        "limitSymbolsToIncludedHeaders": true,
        "path": [
            "${workspaceFolder}/**"
        ]
    }
}
No active translation units.

Other Extensions

No response

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions