gf icon indicating copy to clipboard operation
gf copied to clipboard

Inspect line mode fails to parse variables that contain a number in their name

Open s4my opened this issue 1 year ago • 0 comments

Taking a quick look at the inspect line mode, InspectCurrentLine() has a bug in the way it parses expressions. It won't handle correctly the case where a variable name has a number in it. var1 is valid variable name unlike 1var for e.g.

We can test this with this simple program:

#include <stdlib.h>

int main(int argc, char** argv) {
    int var1 = 4;
    int var = 3;

    return 0;
}

The line with int var1 will be parsed as var and return the value of var instead of var1.

s4my avatar Nov 03 '23 21:11 s4my