Skip to content

Ref-head partial object doc rules can cause nil pointer dereference in compiler #6930

@johanfylling

Description

@johanfylling

The following module will cause a nil pointer dereference at

node.values.Add(rule.Head.Value)
in the BuildRuleIndices compiler stage:

package test
import future.keywords

p.q contains "foo"

p[q] := r if {
	q := "bar"
	r := "baz"
}

Omitting the if keyword causes the issue to not be triggered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions