Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
fix incorrect "uninitialized reference" problem #23
This issue is because the order in which an expression appers in code differs from that in which it is evaluated. For example, given this:
for (p = q; p < q+n; p = r) r = next();
Probably I have to give this kind of detection up until a more formal form of control flow analysis is introduced.
Thanks for your comment.
Sounds like a nice approach. The parse tree from
int j, i; goto label1; label3: j = i; goto label2; label1: i = 0; goto label3; label2: ;
The diagnostic for "uninitialized reference" was mistakenly included when I designed code to issue similar warnings, "defined but not used" and "set but not used". Rather introducing a workaround for a specific case, preparing a method to traverse parse trees following control flow would allow other useful diagnostics not to mention fixing the problem.