Panic when leaving unused :in variable unbound #226

Open
opened 2020-08-06 16:56:57 +00:00 by gburd · 0 comments
gburd commented 2020-08-06 16:56:57 +00:00 (Migrated from github.com)

When leaving an :in variable unbound, like in:

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

After binding only ?f, we panic at 0c31fc7875/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.

When leaving an `:in` variable unbound, like in: ```edn [: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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: greg/mentat#226
No description provided.