mozilla/mentat

Panic when leaving unused `:in` variable unbound

開放

#654 建立於 2018年4月23日

 (5 則留言) (0 個反應) (0 位負責人)Rust (116 個分叉)github user discovery
A-querybuggood first bughelp wanted

倉庫指標

星標
 (1,661 顆星)
PR 合併指標
 (30 天內沒有已合併 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.

貢獻者指南