-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Dataflow analysis occurs at the functional level, and it should be extended to work at the package level. As an introductory approach all conditional statements should be considered as valid paths.
- Every dump statement within a package should be analysed
- Analysis should be preformed on nested function, if they are present in the same package
- Analysis should be done into
ifstatements - Analysis should be done into
forloops - Analysis should be done into
switchstatements
#examples
#local functions
#!go
func foo( var ) type {
var2 := global + var
bar(var2)
return var2
}
func bar( var ) {
otherGlobal = var2
return
}
main () {
buf := receive()
in := instrumenter.Unpack(buf)
res := foo( in )
//dump
}
Here dataflow analysis should be preformed on the function foo and bar the variables affected by the receive are otherGlobal, var2,in, and res.
##if
#!go
//@dump
if ( conditional ) {
var1 := external.foo()
buf = var1
} else {
var2 := external.bar()
buf = var2
}
out := instrumenter.Pack(buf)
send(buf)
In this scenario the variables should be collected regardless of the path taken at runtime. The resulting dump statement should contain the variables {var,var2,buf}
##for
#!go
buf := receive()
in := instrumenter.Unpack(buf)
for ( conditional ) {
a := goHome(in)
b := goToSleep(a)
c := upAgainEarly(b)
}
//@dump
Here the variables {a,b,c} should all be logged regardless of the value of conditional or if the for loop was ever executed, furthermore analysis should be preformed on the local functions, any resulting variables should be logged as well.
##switch
#!go
//@dump
switch(conditional) {
case: "vampire"
buf := holyWater()
case: "wearwolf"
buf := silverBullet()
case: "zombies"
buf := shotgun()
}
send(instrumenter.Pack(buf))
Here variables affected by executing any of the local functions should be logged
[Issue created by wantonsolutions: 2015-08-21]