mozilla/mentat

Panic when leaving unused `:in` variable unbound

Open

#654 geöffnet am 23. Apr. 2018

Auf GitHub ansehen
 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (116 Forks)github user discovery
A-querybuggood first bughelp wanted

Repository-Metriken

Stars
 (1.661 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

When leaving an :in variable unbound, like in:

[:find
 ?e
 :in
 ?f ?unused
 :where
 [(= e f)]
]

After binding only ?f, we panic at https://github.com/mozilla/mentat/blob/0c31fc7875294fdf80f4caf253590999a9214e0d/query-algebrizer/src/clauses/mod.rs#L147

That code is trying to be careful, but the issue is that the subtraction underflows in the above circumstance, since we're subtracting usize instances.

Contributor Guide