proc/variables: support NaN/Inf float values (#706)

Unfortunately go/constant does not support NaN and Inf float values so
we need to store this information alongside.

Fixes #705
This commit is contained in:
Alessandro Arzilli
2017-01-20 23:22:36 +01:00
committed by Derek Parker
parent 449b276fe1
commit d89d115ef9
5 changed files with 56 additions and 6 deletions

View File

@ -448,6 +448,11 @@ func TestEvalExpression(t *testing.T) {
{"str1[0:12]", false, "", "", "string", fmt.Errorf("index out of bounds")},
{"str1[5:3]", false, "", "", "string", fmt.Errorf("index out of bounds")},
// NaN and Inf floats
{"pinf", false, "+Inf", "+Inf", "float64", nil},
{"ninf", false, "-Inf", "-Inf", "float64", nil},
{"nan", false, "NaN", "NaN", "float64", nil},
// pointers
{"*p2", false, "5", "5", "int", nil},
{"p2", true, "*5", "(*int)(0x…", "*int", nil},