crashappsec / con4m

Configuration Language for Mortals
Apache License 2.0
10 stars 1 forks source link

Control flow analysis #26

Open viega opened 1 year ago

viega commented 1 year ago

Do control flow analysis to be able to detect statically when a variable can be referenced before assignment. Right now, this is a runtime error, and it doesn't need to be.

viega commented 1 year ago

Also should make sure w/ this analysis it's fine to have:

if (x) {
  y = 2
}
else {
  y = 4
}
echo(string(y))

Right now, you'd need to put y = 0 at the top.