apoch / epoch-language

Home of the Epoch Programming Language Project
Other
72 stars 3 forks source link

Accessing private members of standard library data-structures #97

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
You are accessing the internal container type of std::stack. This member is not 
guaranteed to be visible in future versions of visual studio (In fact, I can 
guarantee it is not. VS10 has it private), and is not available on other 
platforms. Change the type of std::stack to something more appropriate, like 
std::deque.

Problem Line:
    StringHandle callingfunction = context.InvokedFunctionStack.c.at(context.InvokedFunctionStack.c.size() - 2);

Original issue reported on code.google.com by ryoohki@gmail.com on 1 Feb 2012 at 8:06

GoogleCodeExporter commented 9 years ago
Similar examples exist in other places...

SemanticActions.cpp line 1501:
StatementTypes.c.clear()  should be  StatementTypes = std::stack<Integer32>();
SemanticActions.cpp line 1613:
StatementTypes.c.clear() should be StatementTypes = std::stack<Integer32>();

Original comment by ryoohki@gmail.com on 1 Feb 2012 at 8:10

GoogleCodeExporter commented 9 years ago
SemanticActions.cpp line 2669:
    if(StatementNames.empty() || StatementNames.c.size() <= index)
SemanticActions.cpp line 2672:
    std::wstring name = StatementNames.c.at(index);
SemanticActions.cpp line 2684:
        unsigned paramindex = StatementParamCount.c.at(index);
SemanticActions.cpp line 2693:
        GetAllMatchingOverloads(CompileTimeParameters.c.at(index), paramindex, std::numeric_limits<size_t>::max(), std::numeric_limits<size_t>::max(), outerexpectedtypes, name, namehandle, outnames, outnamehandles);

Original comment by ryoohki@gmail.com on 1 Feb 2012 at 8:18

GoogleCodeExporter commented 9 years ago
Fixed in trunk via patch from issue 100.

Original comment by don.ap...@gmail.com on 7 Feb 2012 at 5:16