mozilla/mentat

Panic when leaving unused `:in` variable unbound

オープン

#654 opened on 2018/04/23

 (5 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (116 件のフォーク)github user discovery
A-querybuggood first bughelp wanted

Repository metrics

Stars
 (1,661 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

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.

コントリビューターガイド