bolt/rules/suspicious/fuel.bend fails
raw source on the hub · import 0x729eecea86ea5a2cdba3a2856a313bca/bolt/rules/suspicious/fuel.bend as Fuel
rule fuel: a call to a def of the same file passes a Nat literal (1000n)
where that def takes its fuel (a parameter named fuel, gas, steps or
budget, or starting with fuel). The fuel-0 arm returns what it has, so
input past the literal comes out cut short, with no error (a JSON printer
that stopped at 1000 tasks). Inside a law, the checker unrolls the fixed
fuel and hangs. Derive the fuel from the input's size (Nat.mul(size, 4n))
or take it as a parameter. A def's own calls are exempt: its step passes
fuel - 1, not a literal.
7 imports
import Base import ../../src.bend as Src import ../../../lazy/lazy.bend as Lazy import ../../finding.bend as F import ../../../syntax/lex.bend as Lex import ../../../syntax/tree.bend as Tree import ../../../syntax/bind.bend as Bind
The reader could not load this file (at 0x729eecea86ea5a2cdba3a2856a313bca/bolt/config.bend:31). What bend.ts says:
Error:
- expected : a fresh name (duplicate declaration: Set)
- observed : 'Set'
Location:
30 | # a name (a group's or a rule's) at a level
31>| type Set is Data:
| ^^^
32 | Set{name: String, level: Level}