proc: fix index access to already-loaded string values (#3184)

Fixes #3176
This commit is contained in:
Alessandro Arzilli
2022-11-08 00:22:12 +01:00
committed by GitHub
parent b072f61bf8
commit cba16f92e8
3 changed files with 23 additions and 2 deletions

View File

@ -1206,6 +1206,10 @@ func TestCallFunction(t *testing.T) {
// Issue 1577
{"1+2", []string{`::3`}, nil},
{`"de"+"mo"`, []string{`::"demo"`}, nil},
// Issue 3176
{`ref.String()[0]`, []string{`:byte:98`}, nil},
{`ref.String()[20]`, nil, errors.New("index out of bounds")},
}
var testcases112 = []testCaseCallFunction{