Skip to content
This repository was archived by the owner on Jan 19, 2024. It is now read-only.
This repository was archived by the owner on Jan 19, 2024. It is now read-only.

Find a way with const-quantified parameters #6

@Nisiyama-Suzune

Description

@Nisiyama-Suzune

Currently Keyedge can deal with single-layered const quantifiers, say const char*. However I do not think it can handle a complex quantifier nightmare until we find out how LibClang and C++ standard deal with all the quantifier-nesting. Given that it occurs sufficiently infrequently in libraries, and there is actually a memory leak issue below, it might be worthwhile to just port these functions by hand when it shows up.

The memory leak thing is like this: say you have a function like foo(const char* str), you cannot free the memory str occupies due to the nature that it is const-quantified. Therefore, if the edge wrapper does not free it, it is leaked unless you const-cast it. In the current implementation the wrapper frees every const variable it comes across with, so that they do not become leaked. However, this also means that whatever pointer pointing to them also becomes invalidated, which sounds to me like a bug more than a feature. We need to revise on how that works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions