tdauth / vjasside

IDE for the scripting languages JASS and vJass of the computer game Warcraft III.
0 stars 0 forks source link

Support basic memory leak analyzer #38

Open tdauth opened 2 years ago

tdauth commented 2 years ago

Even if it doesn't work that well it will be good publicity and make people use the IDE.

For example, if we have the following code:

globals
location udg_MyLocation = Location(0, 0)
endglobals

...

We can look for all globals and then for all function calls of RemoveLocation. If we can trace the variable name to the call everything is fine even if we cannot know if the call ever takes place but at least it is possible. If we cannot trace the variable name and are certain, it is a possible memory leak.

We can do the same with locals.

Tracing the variables might be difficult since they can be passed to functions and other variables and read somewhere else. We have to analyze all read and write calls and overapproximate where the variable could be.

The easiest way is just to check for the variable name.

We could also allow to modify the AST with some leak checks which hook the important functions.