gf
gf copied to clipboard
Inspect line mode fails to parse variables that contain a number in their name
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
.