Skip to content

Missing support for reference-to-pointer parameters in CPP #2485

@lshala

Description

@lshala

Currently we aren't handling reference-to-pointer parameters (T*&) in C++. The following example illustrates the issue:

void badSource(char*& data)
{
    data = new char[100];
    memset(data, 'A', 100 - 1);
    data[99] = '\0';

    delete[] data;
}

void bad()
{
    char* data = NULL;
    badSource(data);
    printLine(data);  // Use-after-free
}

Metadata

Metadata

Assignees

Labels

cxxRelated to C/C++ language parsing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions